diff --git a/build.gradle b/build.gradle index 816dfc4..a0ab1e4 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,6 @@ minecraft { // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: mapping_channel, version: mapping_version - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game. // In most cases, it is not necessary to enable. diff --git a/gradle.properties b/gradle.properties index 0213130..e61404c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=flase +org.gradle.daemon=false # The Minecraft version must agree with the Forge version to get a valid artifact minecraft_version=1.16.5 # The Minecraft version range can use any release version of Minecraft as bounds. @@ -38,7 +38,7 @@ mod_name=Hdm Mod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=MIT # The mod version. See https://semver.org/ -mod_version=1.2.3 +mod_version=1.2 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/us/minecraftchest2/hdm_mod/Hdm_mod.java b/src/main/java/us/minecraftchest2/hdm_mod/Hdm_mod.java index d9e4bea..69b2566 100644 --- a/src/main/java/us/minecraftchest2/hdm_mod/Hdm_mod.java +++ b/src/main/java/us/minecraftchest2/hdm_mod/Hdm_mod.java @@ -2,16 +2,12 @@ package us.minecraftchest2.hdm_mod; import net.minecraft.block.Block; import net.minecraft.block.Blocks; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.InterModComms; -import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; @@ -22,7 +18,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import us.minecraftchest2.hdm_mod.block.ModBlocks; import us.minecraftchest2.hdm_mod.item.ModItems; -import us.minecraftchest2.hdm_mod.world.structure.ModStructures; //import us.minecraftchest2.hdm_mod.init.ItemInit; import java.util.stream.Collectors; @@ -42,8 +37,6 @@ public class Hdm_mod { ModItems.register(modEventBus1); ModBlocks.register(modEventBus1); - ModStructures.register(modEventBus1); - modEventBus1.addListener(this::setup); // Register the enqueueIMC method for modloading modEventBus1.addListener(this::enqueueIMC); @@ -51,7 +44,6 @@ public class Hdm_mod { modEventBus1.addListener(this::processIMC); // Register the doClientStuff method for modloading modEventBus1.addListener(this::doClientStuff); -// ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ModConfig.GENERAL_SPEC, "modconfig.toml"); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); @@ -67,16 +59,10 @@ public class Hdm_mod { // some preinit code LOGGER.info("HELLO FROM PREINIT"); LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName()); - - event.enqueueWork(() ->{ - ModStructures.setupStructures(); - }); } private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client - event.enqueueWork(() -> { - }); } private void enqueueIMC(final InterModEnqueueEvent event) { diff --git a/src/main/java/us/minecraftchest2/hdm_mod/block/ModBlocks.java b/src/main/java/us/minecraftchest2/hdm_mod/block/ModBlocks.java index 6849074..5c7d76f 100644 --- a/src/main/java/us/minecraftchest2/hdm_mod/block/ModBlocks.java +++ b/src/main/java/us/minecraftchest2/hdm_mod/block/ModBlocks.java @@ -3,7 +3,6 @@ package us.minecraftchest2.hdm_mod.block; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; diff --git a/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java b/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java index 09ef11d..13b77b3 100644 --- a/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java +++ b/src/main/java/us/minecraftchest2/hdm_mod/block/custom/Window.java @@ -11,7 +11,6 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.state.StateContainer; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.shapes.IBooleanFunction; @@ -126,6 +125,10 @@ public class Window extends HorizontalBlock { SimpleTeleporter teleporter = new SimpleTeleporter(pos, goingToCustom); player.changeDimension(targetWorld, teleporter); } + + System.out.println("[DEBUG] Portal activated on server!"); + player.sendMessage(new StringTextComponent("Teleport logic running!"), player.getUniqueID()); + player.sendMessage(new StringTextComponent("Teleport attempted!"), player.getUniqueID()); return ActionResultType.SUCCESS; } diff --git a/src/main/java/us/minecraftchest2/hdm_mod/config/ModConfig.java b/src/main/java/us/minecraftchest2/hdm_mod/config/ModConfig.java deleted file mode 100644 index 07aa724..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/config/ModConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -//package us.minecraftchest2.hdm_mod.config; -// -//import net.minecraftforge.common.ForgeConfigSpec; -// -//public class ModConfig { -//public static final ForgeConfigSpec GENERAL_SPEC; -// -//static { -// ForgeConfigSpec.Builder configBuilder = new ForgeConfigSpec.Builder(); -// setupConfig(configBuilder); -// GENERAL_SPEC = configBuilder.build(); -//} -//public static ForgeConfigSpec.IntValue exampleIntConfigEntry; -// -//private static void setupConfig(ForgeConfigSpec.Builder builder) { -// exampleIntConfigEntry = builder.defineInRange("exampleIntConfigEntry", 5, 2, 50); -//} -//} diff --git a/src/main/java/us/minecraftchest2/hdm_mod/config/modconfig.toml b/src/main/java/us/minecraftchest2/hdm_mod/config/modconfig.toml deleted file mode 100644 index 7c482ca..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/config/modconfig.toml +++ /dev/null @@ -1,18 +0,0 @@ -package us.minecraftchest2.hdm_mod.config; - -import net.minecraftforge.common.ForgeConfigSpec; - -public class ModConfig { -public static final ForgeConfigSpec GENERAL_SPEC; - -static { -ForgeConfigSpec.Builder configBuilder = new ForgeConfigSpec.Builder(); -setupConfig(configBuilder); -GENERAL_SPEC = configBuilder.build(); -} -public static ForgeConfigSpec.IntValue exampleIntConfigEntry; - -private static void setupConfig(ForgeConfigSpec.Builder builder) { -exampleIntConfigEntry = builder.defineInRange("exampleIntConfigEntry", 5, 2, 50); -} -} diff --git a/src/main/java/us/minecraftchest2/hdm_mod/item/ModItems.java b/src/main/java/us/minecraftchest2/hdm_mod/item/ModItems.java index 21d7357..f7b0f54 100644 --- a/src/main/java/us/minecraftchest2/hdm_mod/item/ModItems.java +++ b/src/main/java/us/minecraftchest2/hdm_mod/item/ModItems.java @@ -1,17 +1,11 @@ package us.minecraftchest2.hdm_mod.item; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Food; import net.minecraft.item.Item; -import net.minecraft.potion.Effect; -import net.minecraft.potion.EffectInstance; -import net.minecraft.potion.Effects; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import us.minecraftchest2.hdm_mod.Hdm_mod; -import us.minecraftchest2.hdm_mod.block.ModBlocks; import us.minecraftchest2.hdm_mod.item.custom.SubtleKnife; public class ModItems { @@ -24,13 +18,12 @@ public class ModItems { public static final RegistryObject OMELET = ITEMS.register("omelet", - () -> new Item(new Item.Properties().food(new Food.Builder().hunger(5).fastToEat().saturation(20) - .effect(() -> new EffectInstance(Effects.HUNGER, 40, 4), 0.75f).build()).group(ModItemGroup.HDM_ITEM_GROUP))); + () -> new Item(new Item.Properties().group(ModItemGroup.HDM_ITEM_GROUP))); public static final RegistryObject KNIFE = ITEMS.register("subtle_knife", () -> new SubtleKnife(new Item.Properties().maxStackSize(1).group(ModItemGroup.HDM_ITEM_GROUP).maxDamage(2000))); - public static final RegistryObject OMELET_COOKED = ITEMS.register("omelet-cooked", - () -> new Item(new Item.Properties().food(new Food.Builder().hunger(5).fastToEat().saturation(20).build()).group(ModItemGroup.HDM_ITEM_GROUP))); + + public static void register(IEventBus eventBus) { ITEMS.register(eventBus); diff --git a/src/main/java/us/minecraftchest2/hdm_mod/item/custom/StructureLocator.java b/src/main/java/us/minecraftchest2/hdm_mod/item/custom/StructureLocator.java deleted file mode 100644 index bab98f8..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/item/custom/StructureLocator.java +++ /dev/null @@ -1,51 +0,0 @@ -//package us.minecraftchest2.hdm_mod.item.custom; -// -//import net.minecraft.entity.player.PlayerEntity; -//import net.minecraft.item.Item; -//import net.minecraft.item.ItemStack; -//import net.minecraft.util.*; -//import net.minecraft.util.text.StringTextComponent; -//import net.minecraft.world.World; -//import net.minecraft.world.gen.feature.structure.Structure; -////import net.minecraft.world.gen.feature.structure.StructureFeature; -//import net.minecraft.util.math.BlockPos; -//import net.minecraft.world.server.ServerWorld; -// -//public class StructureLocatorItem extends Item { -// -// public StructureLocatorItem(Properties properties) { -// super(properties); -// } -// -// @Override -// public ActionResult use(World world, PlayerEntity player, Hand hand) { -// if (!world.isClientSide && world instanceof ServerWorld) { -// ServerWorld serverWorld = (ServerWorld) world; -// BlockPos playerPos = player.blockPosition(); -// -// // Replace this with your own structure, or any StructureFeature -// Structure structureToFind = Structure.STRONGHOLD; -// -// BlockPos structurePos = serverWorld.getStructureLocation( -// structureToFind, -// playerPos, -// 100, // search radius in chunks -// false -// ); -// -// if (structurePos != null) { -// player.sendMessage( -// new StringTextComponent("Nearest structure at: " + structurePos.getX() + ", " + structurePos.getY() + ", " + structurePos.getZ()), -// player.getUUID() -// ); -// } else { -// player.sendMessage( -// new StringTextComponent("No structure found nearby."), -// player.getUUID() -// ); -// } -// } -// -// return ActionResult.resultSuccess(player.getItemInHand(hand)); -// } -//} diff --git a/src/main/java/us/minecraftchest2/hdm_mod/world/ModWorldEvents.java b/src/main/java/us/minecraftchest2/hdm_mod/world/ModWorldEvents.java deleted file mode 100644 index 2c7dd3f..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/world/ModWorldEvents.java +++ /dev/null @@ -1,33 +0,0 @@ -package us.minecraftchest2.hdm_mod.world; - -import com.mojang.serialization.Codec; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.registry.Registry; -import net.minecraft.world.gen.ChunkGenerator; -import net.minecraft.world.server.ServerWorld; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.ObfuscationReflectionHelper; -import us.minecraftchest2.hdm_mod.Hdm_mod; - -import java.lang.reflect.Method; - -@Mod.EventBusSubscriber(modid = Hdm_mod.MOD_ID) -public class ModWorldEvents { - @SubscribeEvent - public static void addDimensinalSpacing(final WorldEvent.Load event) { - if(event.getWorld() instanceof ServerWorld) { - ServerWorld serverWorld = (ServerWorld) event.getWorld(); - - try { - Method GETCODEC_METHOD = - ObfuscationReflectionHelper.findMethod(ChunkGenerator.class, "func_230347_a_"); - ResourceLocation cgRL = Registry.CHUNK_GENERATOR_CODEC.getKey( - (Codec)GETCODEC_METHOD.invoke(serverWorld.getChunkProvider().generator)); - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/main/java/us/minecraftchest2/hdm_mod/world/dimension/SimpleTeleporter.java b/src/main/java/us/minecraftchest2/hdm_mod/world/dimension/SimpleTeleporter.java index 9337c1f..f852405 100644 --- a/src/main/java/us/minecraftchest2/hdm_mod/world/dimension/SimpleTeleporter.java +++ b/src/main/java/us/minecraftchest2/hdm_mod/world/dimension/SimpleTeleporter.java @@ -5,11 +5,8 @@ package us.minecraftchest2.hdm_mod.world.dimension; import net.minecraft.block.BlockState; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.Fluids; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.util.ITeleporter; import us.minecraftchest2.hdm_mod.block.ModBlocks; @@ -117,33 +114,6 @@ public class SimpleTeleporter implements ITeleporter { } } - if (entity instanceof PlayerEntity) { - PlayerEntity player = (PlayerEntity) entity; - ResourceLocation dimensionKey = destinationWorld.getDimensionKey().getLocation(); - // Only send the welcome message if NOT the overworld - if (!dimensionKey.getPath().equals("overworld")) { - // (Same nice formatting as before) - String path = dimensionKey.getPath(); - String dimensionName; - switch (path) { - case "the_nether": - dimensionName = "the Nether"; - break; - case "the_end": - dimensionName = "the End"; - break; - case "hdm_dimension": - dimensionName = "HDM Dimension"; - break; - default: - dimensionName = path.replace('_', ' '); - dimensionName = dimensionName.substring(0, 1).toUpperCase() + dimensionName.substring(1); - break; - } - player.sendMessage(new StringTextComponent("Welcome to " + dimensionName + "!"), player.getUniqueID()); - } - } - return entity; } } \ No newline at end of file diff --git a/src/main/java/us/minecraftchest2/hdm_mod/world/gen/ModStructureGeneration.java b/src/main/java/us/minecraftchest2/hdm_mod/world/gen/ModStructureGeneration.java deleted file mode 100644 index e083aa1..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/world/gen/ModStructureGeneration.java +++ /dev/null @@ -1,27 +0,0 @@ -package us.minecraftchest2.hdm_mod.world.gen; - -import net.minecraft.util.RegistryKey; -import net.minecraft.util.registry.Registry; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.gen.feature.IFeatureConfig; -import net.minecraft.world.gen.feature.StructureFeature; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.event.world.BiomeLoadingEvent; -import us.minecraftchest2.hdm_mod.world.structure.ModStructures; - -import java.util.List; -import java.util.Set; -import java.util.function.Supplier; - -public class ModStructureGeneration { - public static void generateStructures(final BiomeLoadingEvent event) { - RegistryKey key = RegistryKey.getOrCreateKey(Registry.BIOME_KEY, event.getName()); - Set types = BiomeDictionary.getTypes(key); - - if(types.contains(BiomeDictionary.Type.PLAINS)) { - List>> structures = event.getGeneration().getStructures(); - - structures.add(() -> ModStructures.HOUSE.get().withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG)); - } - } -} \ No newline at end of file diff --git a/src/main/java/us/minecraftchest2/hdm_mod/world/structure/ModStructures.java b/src/main/java/us/minecraftchest2/hdm_mod/world/structure/ModStructures.java deleted file mode 100644 index a7927f5..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/world/structure/ModStructures.java +++ /dev/null @@ -1,113 +0,0 @@ -package us.minecraftchest2.hdm_mod.world.structure; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import net.minecraft.util.registry.WorldGenRegistries; -import net.minecraft.world.gen.feature.NoFeatureConfig; -import net.minecraft.world.gen.feature.structure.Structure; -import net.minecraft.world.gen.settings.DimensionStructuresSettings; -import net.minecraft.world.gen.settings.StructureSeparationSettings; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import us.minecraftchest2.hdm_mod.Hdm_mod; -import us.minecraftchest2.hdm_mod.world.structure.structures.HouseStructure; - -import java.util.HashMap; -import java.util.Map; - -public class ModStructures { - public static final DeferredRegister> STRUCTURES = - DeferredRegister.create(ForgeRegistries.STRUCTURE_FEATURES, Hdm_mod.MOD_ID); - - public static final RegistryObject> HOUSE = - STRUCTURES.register("house", HouseStructure::new); - - /* average distance apart in chunks between spawn attempts */ - /* minimum distance apart in chunks between spawn attempts. MUST BE LESS THAN ABOVE VALUE*/ - /* this modifies the seed of the structure so no two structures always spawn over each-other. - Make this large and unique. */ - public static void setupStructures() { - setupMapSpacingAndLand(HOUSE.get(), - new StructureSeparationSettings(100,50, 1234567890), - true); - } - - /** - * Adds the provided structure to the registry, and adds the separation settings. - * The rarity of the structure is determined based on the values passed into - * this method in the structureSeparationSettings argument. - * This method is called by setupStructures above. - **/ - public static > void setupMapSpacingAndLand(F structure, StructureSeparationSettings structureSeparationSettings, - boolean transformSurroundingLand) { - //add our structures into the map in Structure class - Structure.NAME_STRUCTURE_BIMAP.put(structure.getRegistryName().toString(), structure); - - /* - * Whether surrounding land will be modified automatically to conform to the bottom of the structure. - * Basically, it adds land at the base of the structure like it does for Villages and Outposts. - * Doesn't work well on structure that have pieces stacked vertically or change in heights. - * - */ - if (transformSurroundingLand) { - Structure.field_236384_t_ = ImmutableList.>builder() - .addAll(Structure.field_236384_t_) - .add(structure) - .build(); - } - - /* - * This is the map that holds the default spacing of all structures. - * Always add your structure to here so that other mods can utilize it if needed. - * - * However, while it does propagate the spacing to some correct dimensions from this map, - * it seems it doesn't always work for code made dimensions as they read from this list beforehand. - * - * Instead, we will use the WorldEvent.Load event in ModWorldEvents to add the structure - * spacing from this list into that dimension or to do dimension blacklisting properly. - * We also use our entry in DimensionStructuresSettings.DEFAULTS in WorldEvent.Load as well. - * - * DEFAULTS requires AccessTransformer (See resources/META-INF/accesstransformer.cfg) - */ - DimensionStructuresSettings.field_236191_b_ = - ImmutableMap., StructureSeparationSettings>builder() - .putAll(DimensionStructuresSettings.field_236191_b_) - .put(structure, structureSeparationSettings) - .build(); - - /* - * There are very few mods that relies on seeing your structure in the - * noise settings registry before the world is made. - * - * You may see some mods add their spacings to DimensionSettings.BUILTIN_OVERWORLD instead of the - * NOISE_GENERATOR_SETTINGS loop below but that field only applies for the default overworld and - * won't add to other worldtypes or dimensions (like amplified or Nether). - * So yeah, don't do DimensionSettings.BUILTIN_OVERWORLD. Use the NOISE_GENERATOR_SETTINGS loop - * below instead if you must. - */ - WorldGenRegistries.NOISE_SETTINGS.getEntries().forEach(settings -> { - Map, StructureSeparationSettings> structureMap = - settings.getValue().getStructures().func_236195_a_(); - /* - * Pre-caution in case a mod makes the structure map immutable like datapacks do. - * I take no chances myself. You never know what another mods does... - * - * structureConfig requires AccessTransformer (See resources/META-INF/accesstransformer.cfg) - */ - if (structureMap instanceof ImmutableMap) { - Map, StructureSeparationSettings> tempMap = new HashMap<>(structureMap); - tempMap.put(structure, structureSeparationSettings); - settings.getValue().getStructures().func_236195_a_(); - - } else { - structureMap.put(structure, structureSeparationSettings); - } - }); - } - - public static void register(IEventBus eventBus) { - STRUCTURES.register(eventBus); - } -} \ No newline at end of file diff --git a/src/main/java/us/minecraftchest2/hdm_mod/world/structure/structures/HouseStructure.java b/src/main/java/us/minecraftchest2/hdm_mod/world/structure/structures/HouseStructure.java deleted file mode 100644 index 9a65477..0000000 --- a/src/main/java/us/minecraftchest2/hdm_mod/world/structure/structures/HouseStructure.java +++ /dev/null @@ -1,90 +0,0 @@ -package us.minecraftchest2.hdm_mod.world.structure.structures; - -import net.minecraft.block.BlockState; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SharedSeedRandom; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.ChunkPos; -import net.minecraft.util.math.MutableBoundingBox; -import net.minecraft.util.registry.DynamicRegistries; -import net.minecraft.util.registry.Registry; -import net.minecraft.world.IBlockReader; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.provider.BiomeProvider; -import net.minecraft.world.gen.ChunkGenerator; -import net.minecraft.world.gen.GenerationStage; -import net.minecraft.world.gen.Heightmap; -import net.minecraft.world.gen.feature.NoFeatureConfig; -import net.minecraft.world.gen.feature.jigsaw.JigsawManager; -import net.minecraft.world.gen.feature.structure.AbstractVillagePiece; -import net.minecraft.world.gen.feature.structure.Structure; -import net.minecraft.world.gen.feature.structure.StructureStart; -import net.minecraft.world.gen.feature.structure.VillageConfig; -import net.minecraft.world.gen.feature.template.TemplateManager; -import us.minecraftchest2.hdm_mod.Hdm_mod; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; - -public class HouseStructure extends Structure { - public HouseStructure() { - super(NoFeatureConfig.CODEC); - } - - @Override - public GenerationStage.Decoration getDecorationStage() { - return GenerationStage.Decoration.SURFACE_STRUCTURES; - } - - @Override - protected boolean func_230363_a_(ChunkGenerator chunkGenerator, BiomeProvider biomeSource, - long seed, SharedSeedRandom chunkRandom, int chunkX, int chunkZ, - Biome biome, ChunkPos chunkPos, NoFeatureConfig featureConfig) { - BlockPos centerOfChunk = new BlockPos((chunkX << 4) + 7, 0, (chunkZ << 4) + 7); - int landHeight = chunkGenerator.getHeight(centerOfChunk.getX(), centerOfChunk.getZ(), - Heightmap.Type.WORLD_SURFACE_WG); - - IBlockReader columnOfBlocks = chunkGenerator.func_230348_a_(centerOfChunk.getX(), centerOfChunk.getZ()); - BlockState topBlock = columnOfBlocks.getBlockState(centerOfChunk.up(landHeight)); - - return topBlock.getFluidState().isEmpty(); - } - - @Override - public IStartFactory getStartFactory() { - return HouseStructure.Start::new; - } - - public static class Start extends StructureStart { - public Start(Structure structureIn, int chunkX, int chunkZ, - MutableBoundingBox mutableBoundingBox, int referenceIn, long seedIn) { - super(structureIn, chunkX, chunkZ, mutableBoundingBox, referenceIn, seedIn); - } - - @Override // generatePieces - public void func_230364_a_(DynamicRegistries dynamicRegistryManager, ChunkGenerator chunkGenerator, - TemplateManager templateManagerIn, int chunkX, int chunkZ, Biome biomeIn, - NoFeatureConfig config) { - // Turns the chunk coordinates into actual coordinates we can use. (Gets center of that chunk) - int x = (chunkX << 4) + 7; - int z = (chunkZ << 4) + 7; - BlockPos blockpos = new BlockPos(x, 0, z); - - //addpieces() - JigsawManager.func_242837_a(dynamicRegistryManager, - new VillageConfig(() -> dynamicRegistryManager.getRegistry(Registry.JIGSAW_POOL_KEY) - .getOrDefault(new ResourceLocation(Hdm_mod.MOD_ID, "house/start_pool")), - 10), AbstractVillagePiece::new, chunkGenerator, templateManagerIn, - blockpos, this.components, this.rand,false,true); - - this.components.forEach(piece -> piece.offset(0, 1, 0)); - this.components.forEach(piece -> piece.getBoundingBox().minY -= 1); - - this.recalculateStructureSize(); - - LogManager.getLogger().log(Level.DEBUG, "House at " + - this.components.get(0).getBoundingBox().minX + " " + - this.components.get(0).getBoundingBox().minY + " " + - this.components.get(0).getBoundingBox().minZ); - } - } -} \ No newline at end of file diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg deleted file mode 100644 index b134280..0000000 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ /dev/null @@ -1,4 +0,0 @@ -public-f net.minecraft.world.gen.feature.structure.Structure field_236384_t_ #LAND_TRANSFORMING_STRUCTURES -public-f net.minecraft.world.gen.settings.DimensionStructuresSettings field_236191_b_ #DEFAULT_STRUCTURE_CONFIGS -public-f net.minecraft.world.gen.FlatGenerationSettings field_202247_j #STRUCTURES -public-f net.minecraft.world.gen.settings.DimensionStructuresSettings field_236193_d_ #structures \ No newline at end of file diff --git a/src/main/resources/assets/hdm_mod/blockstates/block_of_dust.json b/src/main/resources/assets/hdm_mod/blockstates/block_of_dust.json index 2e143c2..7f816ed 100644 --- a/src/main/resources/assets/hdm_mod/blockstates/block_of_dust.json +++ b/src/main/resources/assets/hdm_mod/blockstates/block_of_dust.json @@ -1,7 +1,5 @@ { "variants": { - "":[ - {"model": "hdm_mod:block/block_of_dust" } - ] + "main": {"model": "hdm_mod:block/block_of_dust" } } } \ No newline at end of file diff --git a/src/main/resources/assets/hdm_mod/blockstates/window.json b/src/main/resources/assets/hdm_mod/blockstates/window.json index 5741ab8..5bd80c6 100644 --- a/src/main/resources/assets/hdm_mod/blockstates/window.json +++ b/src/main/resources/assets/hdm_mod/blockstates/window.json @@ -1,7 +1,5 @@ { "variants": { - "": [ - {"model": "hdm_mod:block/window" } - ] + "main": {"model": "hdm_mod:block/window" } } } \ No newline at end of file diff --git a/src/main/resources/assets/hdm_mod/lang/en_us.json b/src/main/resources/assets/hdm_mod/lang/en_us.json index 30eb76e..efdaf9b 100644 --- a/src/main/resources/assets/hdm_mod/lang/en_us.json +++ b/src/main/resources/assets/hdm_mod/lang/en_us.json @@ -4,7 +4,6 @@ "item.hdm_mod.subtle_knife": "Subtle Knife", "item.hdm_mod.omelet": "Omelet", - "item.hdm_mod.omelet-cooked": "Omelet", "item.hdm_mod.dust": "Dust", "block.hdm_mod.block_of_dust": "Block of Dust", "block.hdm_mod.window": "Window" diff --git a/src/main/resources/assets/hdm_mod/models/block/window.json b/src/main/resources/assets/hdm_mod/models/block/window.json index f302f99..43306a9 100644 --- a/src/main/resources/assets/hdm_mod/models/block/window.json +++ b/src/main/resources/assets/hdm_mod/models/block/window.json @@ -1,6 +1,6 @@ { "parent": "block/cube_all", "textures" : { - "all": "hdm_mod:block/portalblock" + "all": "hdm_mod:block/grey" } } \ No newline at end of file diff --git a/src/main/resources/assets/hdm_mod/models/item/omelet-cooked.json b/src/main/resources/assets/hdm_mod/models/item/omelet-cooked.json deleted file mode 100644 index 2dccee3..0000000 --- a/src/main/resources/assets/hdm_mod/models/item/omelet-cooked.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "item/generated", - "textures": { - "layer0": "hdm_mod:item/omelet" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/hdm_mod/textures/block/portalblock.png b/src/main/resources/assets/hdm_mod/textures/block/portalblock.png deleted file mode 100644 index 29a8340..0000000 Binary files a/src/main/resources/assets/hdm_mod/textures/block/portalblock.png and /dev/null differ diff --git a/src/main/resources/assets/hdm_mod/textures/item/knife.png b/src/main/resources/assets/hdm_mod/textures/item/knife.png index 01538f8..859a66d 100644 Binary files a/src/main/resources/assets/hdm_mod/textures/item/knife.png and b/src/main/resources/assets/hdm_mod/textures/item/knife.png differ diff --git a/src/main/resources/assets/hdm_mod/textures/item/omelet.png b/src/main/resources/assets/hdm_mod/textures/item/omelet.png index ca90c3f..edf0513 100644 Binary files a/src/main/resources/assets/hdm_mod/textures/item/omelet.png and b/src/main/resources/assets/hdm_mod/textures/item/omelet.png differ diff --git a/src/main/resources/data/hdm_mod/loot_tables/blocks/block_of_dust.json b/src/main/resources/data/hdm_mod/loot_tables/blocks/block_of_dust.json index a333168..3424ef6 100644 --- a/src/main/resources/data/hdm_mod/loot_tables/blocks/block_of_dust.json +++ b/src/main/resources/data/hdm_mod/loot_tables/blocks/block_of_dust.json @@ -3,12 +3,10 @@ "pools": [ { "rolls": 1, - "entries": [ + "entries":[ { "type": "minecraft:item", - "name": "hdm_mod:dust", - "weight": 4, - "quality": 9 + "name": "hdm_mod:dust" } ] } diff --git a/src/main/resources/data/hdm_mod/recipes/omelet.json b/src/main/resources/data/hdm_mod/recipes/omelet.json deleted file mode 100644 index 491aaec..0000000 --- a/src/main/resources/data/hdm_mod/recipes/omelet.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "#B", - "E " - ], - "key": { - "#": { - "item": "minecraft:porkchop" - }, - "B": { - "item": "minecraft:brown_mushroom" - }, - "E": { - "item": "minecraft:egg" - } - }, - "result": { - "item": "hdm_mod:omelet", - "count": 1 - }, - "group": "omelets" -} \ No newline at end of file diff --git a/src/main/resources/data/hdm_mod/recipes/omelet_cooked.json b/src/main/resources/data/hdm_mod/recipes/omelet_cooked.json deleted file mode 100644 index 1a11c97..0000000 --- a/src/main/resources/data/hdm_mod/recipes/omelet_cooked.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "minecraft:smelting", - "category": "food", - "ingredient": { - "item": "hdm_mod:omelet" - }, - "result": "hdm_mod:omelet-cooked", - "experience": 1, - "cookingtime": 200, - "group": "omelets" -} \ No newline at end of file diff --git a/src/main/resources/data/hdm_mod/structures/dust_house.nbt b/src/main/resources/data/hdm_mod/structures/dust_house.nbt deleted file mode 100644 index 049ae74..0000000 Binary files a/src/main/resources/data/hdm_mod/structures/dust_house.nbt and /dev/null differ diff --git a/src/main/resources/data/hdm_mod/worldgen/template_pool/house/start_pool.json b/src/main/resources/data/hdm_mod/worldgen/template_pool/house/start_pool.json deleted file mode 100644 index b805d55..0000000 --- a/src/main/resources/data/hdm_mod/worldgen/template_pool/house/start_pool.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "hdm_mod:house/start_pool", - "fallback": "minecraft:empty", - "elements": [ - { - "weight": 1, - "element": { - "location": "hdm_mod:house", - "processors": "minecraft:empty", - "projection": "rigid", - "element_type": "minecraft:single_pool_element" - } - } - ] -} \ No newline at end of file