end update fahhhh
This commit is contained in:
@@ -6,7 +6,7 @@ minecraft_version=1.20.1
|
|||||||
yarn_mappings=1.20.1+build.10
|
yarn_mappings=1.20.1+build.10
|
||||||
loader_version=0.18.3
|
loader_version=0.18.3
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=26.3.28
|
mod_version=26.3.29
|
||||||
maven_group=dev.tggamesyt
|
maven_group=dev.tggamesyt
|
||||||
archives_base_name=szar
|
archives_base_name=szar
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|||||||
@@ -565,6 +565,18 @@ public class SzarClient implements ClientModInitializer {
|
|||||||
Szar.CANNABIS_BLOCK,
|
Szar.CANNABIS_BLOCK,
|
||||||
RenderLayer.getCutout()
|
RenderLayer.getCutout()
|
||||||
);
|
);
|
||||||
|
BlockRenderLayerMap.INSTANCE.putBlock(
|
||||||
|
CONNECT_FOUR_BLOCK,
|
||||||
|
RenderLayer.getCutout()
|
||||||
|
);
|
||||||
|
BlockRenderLayerMap.INSTANCE.putBlock(
|
||||||
|
SMALL_CHORUS,
|
||||||
|
RenderLayer.getCutout()
|
||||||
|
);
|
||||||
|
BlockRenderLayerMap.INSTANCE.putBlock(
|
||||||
|
SMALL_CHORUS_FLOWER,
|
||||||
|
RenderLayer.getCutout()
|
||||||
|
);
|
||||||
BlockRenderLayerMap.INSTANCE.putBlock(
|
BlockRenderLayerMap.INSTANCE.putBlock(
|
||||||
ROULETTE_BLOCK,
|
ROULETTE_BLOCK,
|
||||||
RenderLayer.getCutout()
|
RenderLayer.getCutout()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class ChorusEndStone extends EndSpreadableBlock implements Fertilizable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state, boolean isClient) {
|
public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state, boolean isClient) {
|
||||||
return world.getBlockState(pos.up()).isAir();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -35,43 +35,23 @@ public class ChorusEndStone extends EndSpreadableBlock implements Fertilizable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
|
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
|
||||||
BlockPos start = pos.up();
|
BlockPos target = pos.up();
|
||||||
|
|
||||||
// your custom placed feature (we'll register this next)
|
|
||||||
var registry = world.getRegistryManager().get(RegistryKeys.PLACED_FEATURE);
|
var registry = world.getRegistryManager().get(RegistryKeys.PLACED_FEATURE);
|
||||||
|
var featureEntry = registry.getEntry(Szar.SMALL_CHORUS_PLACED);
|
||||||
|
|
||||||
var smallChorusFeature = registry.getEntry(Szar.SMALL_CHORUS_PLACED);
|
// ❌ if blocked, do nothing
|
||||||
|
if (!world.getBlockState(target).isAir()) return;
|
||||||
|
|
||||||
outer:
|
// 🌸 VERY RARE chorus flower (~5%)
|
||||||
for (int i = 0; i < 128; i++) {
|
if (random.nextInt(20) == 0) {
|
||||||
BlockPos target = start;
|
|
||||||
|
|
||||||
for (int j = 0; j < i / 16; j++) {
|
|
||||||
target = target.add(
|
|
||||||
random.nextInt(3) - 1,
|
|
||||||
(random.nextInt(3) - 1) * random.nextInt(3) / 2,
|
|
||||||
random.nextInt(3) - 1
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!world.getBlockState(target.down()).isOf(this)
|
|
||||||
|| world.getBlockState(target).isFullCube(world, target)) {
|
|
||||||
continue outer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BlockState targetState = world.getBlockState(target);
|
|
||||||
|
|
||||||
if (targetState.isAir()) {
|
|
||||||
|
|
||||||
// 🌟 Rare: spawn chorus flower (~1/12 chance)
|
|
||||||
if (random.nextInt(12) == 0) {
|
|
||||||
world.setBlockState(target, Blocks.CHORUS_FLOWER.getDefaultState());
|
world.setBlockState(target, Blocks.CHORUS_FLOWER.getDefaultState());
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🌿 Common: spawn your custom feature
|
// 🌿 otherwise place ONE patch
|
||||||
if (smallChorusFeature.isPresent()) {
|
if (featureEntry.isPresent()) {
|
||||||
smallChorusFeature.get().value().generateUnregistered(
|
featureEntry.get().value().generateUnregistered(
|
||||||
world,
|
world,
|
||||||
world.getChunkManager().getChunkGenerator(),
|
world.getChunkManager().getChunkGenerator(),
|
||||||
random,
|
random,
|
||||||
@@ -79,6 +59,4 @@ public class ChorusEndStone extends EndSpreadableBlock implements Fertilizable {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
package dev.tggamesyt.szar;
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.PlantBlock;
|
import net.minecraft.block.PlantBlock;
|
||||||
|
import net.minecraft.block.ShapeContext;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
|
|
||||||
public class SmallChorusBlock extends PlantBlock {
|
public class SmallChorusBlock extends PlantBlock {
|
||||||
|
protected static final VoxelShape SHAPE = Block.createCuboidShape((double)2.0F, (double)0.0F, (double)2.0F, (double)14.0F, (double)13.0F, (double)14.0F);
|
||||||
public SmallChorusBlock(Settings settings) {
|
public SmallChorusBlock(Settings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
|
||||||
|
return SHAPE;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) {
|
protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) {
|
||||||
return floor.isOf(Szar.CHORUS_ENDSTONE);
|
return floor.isOf(Szar.CHORUS_ENDSTONE);
|
||||||
|
|||||||
52
src/main/java/dev/tggamesyt/szar/SmallChorusFlowerBlock.java
Normal file
52
src/main/java/dev/tggamesyt/szar/SmallChorusFlowerBlock.java
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.block.PlantBlock;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.random.Random;
|
||||||
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
|
import net.minecraft.world.BlockView;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class SmallChorusFlowerBlock extends PlantBlock {
|
||||||
|
|
||||||
|
protected static final VoxelShape SHAPE = Block.createCuboidShape(
|
||||||
|
2.0, 0.0, 2.0,
|
||||||
|
14.0, 13.0, 14.0
|
||||||
|
);
|
||||||
|
|
||||||
|
public SmallChorusFlowerBlock(Settings settings) {
|
||||||
|
super(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, net.minecraft.block.ShapeContext context) {
|
||||||
|
return SHAPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos) {
|
||||||
|
return floor.isOf(Szar.CHORUS_ENDSTONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {
|
||||||
|
|
||||||
|
// small chance per random tick → averages ~5–10 minutes
|
||||||
|
if (random.nextInt(6) == 0) { // tweak this number
|
||||||
|
|
||||||
|
// only grow if space above
|
||||||
|
if (world.getBlockState(pos.up()).isAir()) {
|
||||||
|
world.setBlockState(pos, Blocks.CHORUS_FLOWER.getDefaultState());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasRandomTicks(BlockState state) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/main/java/dev/tggamesyt/szar/SurfaceReplaceFeature.java
Normal file
48
src/main/java/dev/tggamesyt/szar/SurfaceReplaceFeature.java
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.StructureWorldAccess;
|
||||||
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
|
import net.minecraft.world.gen.feature.Feature;
|
||||||
|
import net.minecraft.world.gen.feature.util.FeatureContext;
|
||||||
|
|
||||||
|
public class SurfaceReplaceFeature extends Feature<DefaultFeatureConfig> {
|
||||||
|
|
||||||
|
public SurfaceReplaceFeature(Codec<DefaultFeatureConfig> codec) {
|
||||||
|
super(codec);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean generate(FeatureContext<DefaultFeatureConfig> context) {
|
||||||
|
StructureWorldAccess world = context.getWorld();
|
||||||
|
BlockPos origin = context.getOrigin();
|
||||||
|
|
||||||
|
// snap to chunk corner
|
||||||
|
int startX = (origin.getX() >> 4) << 4;
|
||||||
|
int startZ = (origin.getZ() >> 4) << 4;
|
||||||
|
|
||||||
|
for (int x = 0; x < 16; x++) {
|
||||||
|
for (int z = 0; z < 16; z++) {
|
||||||
|
BlockPos column = new BlockPos(startX + x, origin.getY(), startZ + z);
|
||||||
|
|
||||||
|
for (int i = 10; i > -10; i--) {
|
||||||
|
BlockPos pos = column.up(i);
|
||||||
|
BlockState state = world.getBlockState(pos);
|
||||||
|
|
||||||
|
if (state.isOf(Blocks.END_STONE)) {
|
||||||
|
world.setBlockState(pos, Szar.CHORUS_ENDSTONE.getDefaultState(), Block.NOTIFY_LISTENERS);
|
||||||
|
break;
|
||||||
|
} else if (!state.isAir()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package dev.tggamesyt.szar;
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.mojang.authlib.minecraft.client.MinecraftClient;
|
|
||||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||||
@@ -28,6 +27,7 @@ import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
|
|||||||
import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper;
|
import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.world.poi.PointOfInterestHelper;
|
import net.fabricmc.fabric.api.object.builder.v1.world.poi.PointOfInterestHelper;
|
||||||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
||||||
|
import net.fabricmc.fabric.impl.biome.TheEndBiomeData;
|
||||||
import net.minecraft.advancement.Advancement;
|
import net.minecraft.advancement.Advancement;
|
||||||
import net.minecraft.block.*;
|
import net.minecraft.block.*;
|
||||||
import net.minecraft.block.dispenser.FallibleItemDispenserBehavior;
|
import net.minecraft.block.dispenser.FallibleItemDispenserBehavior;
|
||||||
@@ -75,6 +75,7 @@ import net.minecraft.village.TradeOffer;
|
|||||||
import net.minecraft.village.VillagerProfession;
|
import net.minecraft.village.VillagerProfession;
|
||||||
import net.minecraft.world.Heightmap;
|
import net.minecraft.world.Heightmap;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.BiomeKeys;
|
import net.minecraft.world.biome.BiomeKeys;
|
||||||
import net.minecraft.world.dimension.DimensionOptions;
|
import net.minecraft.world.dimension.DimensionOptions;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
@@ -90,14 +91,12 @@ import net.minecraft.world.poi.PointOfInterestType;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static dev.tggamesyt.szar.ServerCosmetics.USERS;
|
import static dev.tggamesyt.szar.ServerCosmetics.USERS;
|
||||||
import static dev.tggamesyt.szar.ServerCosmetics.sync;
|
|
||||||
|
|
||||||
public class Szar implements ModInitializer {
|
public class Szar implements ModInitializer {
|
||||||
public static final String MOD_ID = "szar";
|
public static final String MOD_ID = "szar";
|
||||||
@@ -164,6 +163,7 @@ public class Szar implements ModInitializer {
|
|||||||
new Identifier(Szar.MOD_ID, "won"),
|
new Identifier(Szar.MOD_ID, "won"),
|
||||||
SoundEvent.of(new Identifier(Szar.MOD_ID, "won"))
|
SoundEvent.of(new Identifier(Szar.MOD_ID, "won"))
|
||||||
);
|
);
|
||||||
|
private static final Set<Integer> chorusRolledEntities = new HashSet<>();
|
||||||
public static final SoundEvent MERL_SOUND =
|
public static final SoundEvent MERL_SOUND =
|
||||||
SoundEvent.of(new Identifier(MOD_ID, "merl"));
|
SoundEvent.of(new Identifier(MOD_ID, "merl"));
|
||||||
public static final Map<UUID, Long> recentPlaneCrashDeaths = new java.util.HashMap<>();
|
public static final Map<UUID, Long> recentPlaneCrashDeaths = new java.util.HashMap<>();
|
||||||
@@ -389,6 +389,7 @@ public class Szar implements ModInitializer {
|
|||||||
// end update
|
// end update
|
||||||
entries.add(Szar.CHORUS_ENDSTONE_ITEM);
|
entries.add(Szar.CHORUS_ENDSTONE_ITEM);
|
||||||
entries.add(Szar.SMALL_CHORUS_ITEM);
|
entries.add(Szar.SMALL_CHORUS_ITEM);
|
||||||
|
entries.add(Szar.SMALL_CHORUS_FLOWER_ITEM);
|
||||||
// blueprint stuff
|
// blueprint stuff
|
||||||
entries.add(BlueprintBlocks.BLUEPRINT);
|
entries.add(BlueprintBlocks.BLUEPRINT);
|
||||||
entries.add(BlueprintBlocks.BLUEPRINT_DOOR_ITEM);
|
entries.add(BlueprintBlocks.BLUEPRINT_DOOR_ITEM);
|
||||||
@@ -1383,6 +1384,35 @@ public class Szar implements ModInitializer {
|
|||||||
ServerLifecycleEvents.SERVER_STARTED.register(SzarGameRules::pushToGameRules);
|
ServerLifecycleEvents.SERVER_STARTED.register(SzarGameRules::pushToGameRules);
|
||||||
|
|
||||||
BlueprintBlocks.init();
|
BlueprintBlocks.init();
|
||||||
|
|
||||||
|
ServerTickEvents.END_SERVER_TICK.register(server -> {
|
||||||
|
for (ServerWorld world : server.getWorlds()) {
|
||||||
|
|
||||||
|
|
||||||
|
// Handle item transformation
|
||||||
|
for (ItemEntity item : world.getEntitiesByType(EntityType.ITEM, e -> true)) {
|
||||||
|
if (!item.getStack().isOf(Items.CHORUS_FRUIT)) continue;
|
||||||
|
|
||||||
|
BlockPos pos = item.getBlockPos();
|
||||||
|
BlockPos down = pos.down();
|
||||||
|
|
||||||
|
if (!chorusRolledEntities.contains(item.getId()) && world.getBlockState(down).isOf(Szar.CHORUS_ENDSTONE)) {
|
||||||
|
chorusRolledEntities.add(item.getId());
|
||||||
|
|
||||||
|
int roll = world.getRandom().nextInt(100); // 0-99
|
||||||
|
if (roll < 5) { // 5% -> 1 in 20 chance
|
||||||
|
world.setBlockState(pos, Szar.SMALL_CHORUS.getDefaultState());
|
||||||
|
item.remove(Entity.RemovalReason.DISCARDED);
|
||||||
|
} else if (roll == 5) { // 2% -> 1 in 50 chance
|
||||||
|
world.setBlockState(pos, Szar.SMALL_CHORUS_FLOWER.getDefaultState());
|
||||||
|
item.remove(Entity.RemovalReason.DISCARDED);
|
||||||
|
}
|
||||||
|
// otherwise do nothing, just mark it as rolled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
TheEndBiomeData.addEndBiomeReplacement(BiomeKeys.END_HIGHLANDS, Szar.CHORUS_FOREST, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Block TIC_TAC_TOE_BLOCK = Registry.register(
|
public static final Block TIC_TAC_TOE_BLOCK = Registry.register(
|
||||||
@@ -1454,7 +1484,7 @@ public class Szar implements ModInitializer {
|
|||||||
public static final Block CHORUS_ENDSTONE = Registry.register(
|
public static final Block CHORUS_ENDSTONE = Registry.register(
|
||||||
Registries.BLOCK,
|
Registries.BLOCK,
|
||||||
new Identifier(MOD_ID, "chorus_endstone"),
|
new Identifier(MOD_ID, "chorus_endstone"),
|
||||||
new Block(FabricBlockSettings.copyOf(Blocks.END_STONE))
|
new ChorusEndStone(FabricBlockSettings.copyOf(Blocks.END_STONE).ticksRandomly())
|
||||||
);
|
);
|
||||||
public static final Item CHORUS_ENDSTONE_ITEM = Registry.register(
|
public static final Item CHORUS_ENDSTONE_ITEM = Registry.register(
|
||||||
Registries.ITEM,
|
Registries.ITEM,
|
||||||
@@ -1471,6 +1501,25 @@ public class Szar implements ModInitializer {
|
|||||||
new Identifier(MOD_ID, "small_chorus"),
|
new Identifier(MOD_ID, "small_chorus"),
|
||||||
new BlockItem(SMALL_CHORUS, new FabricItemSettings())
|
new BlockItem(SMALL_CHORUS, new FabricItemSettings())
|
||||||
);
|
);
|
||||||
|
public static final Block SMALL_CHORUS_FLOWER = Registry.register(
|
||||||
|
Registries.BLOCK,
|
||||||
|
new Identifier(MOD_ID, "small_chorus_flower"),
|
||||||
|
new SmallChorusFlowerBlock(FabricBlockSettings.copyOf(Blocks.POPPY).ticksRandomly())
|
||||||
|
);
|
||||||
|
public static final Item SMALL_CHORUS_FLOWER_ITEM = Registry.register(
|
||||||
|
Registries.ITEM,
|
||||||
|
new Identifier(MOD_ID, "small_chorus_flower"),
|
||||||
|
new BlockItem(SMALL_CHORUS_FLOWER, new FabricItemSettings())
|
||||||
|
);
|
||||||
|
public static final RegistryKey<Biome> CHORUS_FOREST = RegistryKey.of(
|
||||||
|
RegistryKeys.BIOME,
|
||||||
|
new Identifier(MOD_ID, "chorus_forest")
|
||||||
|
);
|
||||||
|
public static final Feature<DefaultFeatureConfig> SURFACE_REPLACE = Registry.register(
|
||||||
|
Registries.FEATURE,
|
||||||
|
new Identifier(MOD_ID, "surface_replace"),
|
||||||
|
new SurfaceReplaceFeature(DefaultFeatureConfig.CODEC)
|
||||||
|
);
|
||||||
// Blocks
|
// Blocks
|
||||||
public static final TrackerBlock TRACKER_BLOCK = Registry.register(
|
public static final TrackerBlock TRACKER_BLOCK = Registry.register(
|
||||||
Registries.BLOCK, new Identifier(MOD_ID, "tracker"),
|
Registries.BLOCK, new Identifier(MOD_ID, "tracker"),
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package dev.tggamesyt.szar.mixin;
|
||||||
|
|
||||||
|
import dev.tggamesyt.szar.Szar;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.registry.tag.TagKey;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.world.gen.feature.ChorusPlantFeature;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(ChorusPlantFeature.class)
|
||||||
|
public class ChorusPlantFeatureMixin {
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private static final TagKey<Block> ENDSTONES =
|
||||||
|
TagKey.of(RegistryKeys.BLOCK, new Identifier(Szar.MOD_ID, "endstones"));
|
||||||
|
|
||||||
|
@Redirect(
|
||||||
|
method = "generate",
|
||||||
|
at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
private boolean replaceEndStoneCheck(BlockState state, Block block) {
|
||||||
|
if (block == Blocks.END_STONE) {
|
||||||
|
return state.isIn(ENDSTONES);
|
||||||
|
}
|
||||||
|
return state.isOf(block);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package dev.tggamesyt.szar.mixin;
|
||||||
|
|
||||||
|
import dev.tggamesyt.szar.Szar;
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.world.gen.surfacebuilder.MaterialRules;
|
||||||
|
import net.minecraft.world.gen.surfacebuilder.VanillaSurfaceRules;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(VanillaSurfaceRules.class)
|
||||||
|
public class VanillaSurfaceRulesMixin {
|
||||||
|
|
||||||
|
@Inject(method = "getEndStoneRule", at = @At("RETURN"), cancellable = true)
|
||||||
|
private static void overrideEndStoneRule(CallbackInfoReturnable<MaterialRules.MaterialRule> cir) {
|
||||||
|
MaterialRules.MaterialRule chorusForest = MaterialRules.condition(
|
||||||
|
MaterialRules.biome(Szar.CHORUS_FOREST),
|
||||||
|
MaterialRules.block(Szar.CHORUS_ENDSTONE.getDefaultState())
|
||||||
|
);
|
||||||
|
|
||||||
|
cir.setReturnValue(MaterialRules.sequence(chorusForest, cir.getReturnValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "szar:block/small_chorus_flower"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -201,5 +201,6 @@
|
|||||||
"item.szar.blueprint": "Blueprint",
|
"item.szar.blueprint": "Blueprint",
|
||||||
|
|
||||||
"block.szar.chorus_endstone": "Chorus EndStone",
|
"block.szar.chorus_endstone": "Chorus EndStone",
|
||||||
"block.szar.small_chorus": "Small Chorus"
|
"block.szar.small_chorus": "Small Chorus",
|
||||||
|
"block.szar.small_chorus_flower": "Small Chorus Flower"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "block/cross",
|
||||||
|
"textures": {
|
||||||
|
"cross": "szar:block/small_chorus_flower"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "szar:block/small_chorus_flower"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -2,6 +2,7 @@
|
|||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"szar:uranium_ore",
|
"szar:uranium_ore",
|
||||||
"szar:niggerite_block"
|
"szar:niggerite_block",
|
||||||
|
"szar:chorus_endstone"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,28 +2,34 @@
|
|||||||
"type": "minecraft:block",
|
"type": "minecraft:block",
|
||||||
"pools": [
|
"pools": [
|
||||||
{
|
{
|
||||||
"rolls": 1,
|
"bonus_rolls": 0.0,
|
||||||
"entries": [
|
"entries": [
|
||||||
{
|
{
|
||||||
"type": "minecraft:item",
|
"type": "minecraft:item",
|
||||||
"name": "szar:blueprint_slab",
|
|
||||||
"functions": [
|
"functions": [
|
||||||
{
|
{
|
||||||
"function": "minecraft:set_count",
|
"add": false,
|
||||||
"count": {
|
"conditions": [
|
||||||
"type": "minecraft:block_state_property",
|
{
|
||||||
"block": "szar:blueprint_slab",
|
"block": "szar:blueprint_slab",
|
||||||
"property": "type",
|
"condition": "minecraft:block_state_property",
|
||||||
"values": {
|
"properties": {
|
||||||
"double": 2,
|
"type": "double"
|
||||||
"bottom": 1,
|
|
||||||
"top": 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"count": 2.0,
|
||||||
|
"function": "minecraft:set_count"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "minecraft:explosion_decay"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"name": "szar:blueprint_slab"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"rolls": 1.0
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"random_sequence": "minecraft:blocks/stone_slab"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"bonus_rolls": 0.0,
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:alternatives",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:match_tool",
|
||||||
|
"predicate": {
|
||||||
|
"enchantments": [
|
||||||
|
{
|
||||||
|
"enchantment": "minecraft:silk_touch",
|
||||||
|
"levels": {
|
||||||
|
"min": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "szar:chorus_endstone"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:survives_explosion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "minecraft:end_stone"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rolls": 1.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"random_sequence": "minecraft:blocks/grass_block"
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"bonus_rolls": 0.0,
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:alternatives",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:match_tool",
|
||||||
|
"predicate": {
|
||||||
|
"items": [
|
||||||
|
"minecraft:shears"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "szar:small_chorus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"chance": 0.125,
|
||||||
|
"condition": "minecraft:random_chance"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"enchantment": "minecraft:fortune",
|
||||||
|
"formula": "minecraft:uniform_bonus_count",
|
||||||
|
"function": "minecraft:apply_bonus",
|
||||||
|
"parameters": {
|
||||||
|
"bonusMultiplier": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"function": "minecraft:explosion_decay"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "minecraft:chorus_fruit"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rolls": 1.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"random_sequence": "minecraft:blocks/grass"
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"bonus_rolls": 0.0,
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:survives_explosion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "szar:small_chorus_flower"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rolls": 1.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"random_sequence": "minecraft:blocks/poppy"
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"temperature": 0.5,
|
||||||
|
"downfall": 0.0,
|
||||||
|
"has_precipitation": false,
|
||||||
|
"effects": {
|
||||||
|
"sky_color": 0,
|
||||||
|
"fog_color": 10518688,
|
||||||
|
"water_color": 4159204,
|
||||||
|
"water_fog_color": 329011,
|
||||||
|
"mood_sound": {
|
||||||
|
"sound": "minecraft:ambient.cave",
|
||||||
|
"tick_delay": 6000,
|
||||||
|
"block_search_extent": 8,
|
||||||
|
"offset": 2.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"creature_spawn_probability": 0.1,
|
||||||
|
"spawners": {
|
||||||
|
"monster": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:enderman",
|
||||||
|
"weight": 10,
|
||||||
|
"minCount": 1,
|
||||||
|
"maxCount": 4
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"creature": [],
|
||||||
|
"ambient": [],
|
||||||
|
"water_creature": [],
|
||||||
|
"water_ambient": [],
|
||||||
|
"underground_water_creature": [],
|
||||||
|
"axolotls": [],
|
||||||
|
"misc": []
|
||||||
|
},
|
||||||
|
"spawn_costs": {},
|
||||||
|
"features": [
|
||||||
|
[], [], [], [], [], [], [],
|
||||||
|
[
|
||||||
|
"szar:small_chorus_patch",
|
||||||
|
"minecraft:end_spike",
|
||||||
|
"minecraft:chorus_plant"
|
||||||
|
],
|
||||||
|
[], []
|
||||||
|
],
|
||||||
|
"carvers": {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"type": "szar:surface_replace",
|
||||||
|
"config": {}
|
||||||
|
}
|
||||||
@@ -6,10 +6,21 @@
|
|||||||
"type": "minecraft:simple_block",
|
"type": "minecraft:simple_block",
|
||||||
"config": {
|
"config": {
|
||||||
"to_place": {
|
"to_place": {
|
||||||
"type": "minecraft:simple_state_provider",
|
"type": "minecraft:weighted_state_provider",
|
||||||
"state": {
|
"entries": [
|
||||||
"Name": "szar:small_chorus_block"
|
{
|
||||||
|
"weight": 9,
|
||||||
|
"data": {
|
||||||
|
"Name": "szar:small_chorus"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"weight": 1,
|
||||||
|
"data": {
|
||||||
|
"Name": "szar:small_chorus_flower"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -24,7 +35,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tries": 32,
|
"tries": 32,
|
||||||
"xz_spread": 7,
|
"xz_spread": 5,
|
||||||
"y_spread": 3
|
"y_spread": 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"feature": "szar:chorus_endstone_surface",
|
||||||
|
"placement": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:in_square"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:heightmap",
|
||||||
|
"heightmap": "WORLD_SURFACE_WG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:biome"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
"feature": "szar:small_chorus",
|
"feature": "szar:small_chorus",
|
||||||
"placement": [
|
"placement": [
|
||||||
{ "type": "minecraft:count", "count": 5 },
|
{ "type": "minecraft:count", "count": 5 },
|
||||||
{ "type": "minecraft:in_square" },
|
{ "type": "minecraft:in_square" }
|
||||||
{ "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE_WG" },
|
|
||||||
{ "type": "minecraft:biome" }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
"ChorusFlowerBlockMixin",
|
"ChorusFlowerBlockMixin",
|
||||||
"ChorusPlantBlockMixin",
|
"ChorusPlantBlockMixin",
|
||||||
|
"ChorusPlantFeatureMixin",
|
||||||
"CraftingScreenHandlerMixin",
|
"CraftingScreenHandlerMixin",
|
||||||
"CraftingScreenHandlerMixin2",
|
"CraftingScreenHandlerMixin2",
|
||||||
"EntityCollisionMixin",
|
"EntityCollisionMixin",
|
||||||
@@ -18,7 +19,8 @@
|
|||||||
"PlayerEntityMixin",
|
"PlayerEntityMixin",
|
||||||
"PlayerInteractionMixin",
|
"PlayerInteractionMixin",
|
||||||
"PlayerSleepMixin",
|
"PlayerSleepMixin",
|
||||||
"RadiatedItemMixin"
|
"RadiatedItemMixin",
|
||||||
|
"VanillaSurfaceRulesMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
Reference in New Issue
Block a user