mirror of
https://github.com/dragonruler1000/hdm-mod.git
synced 2025-06-29 00:19:32 -05:00
Update mod version to 1.2.3, rename DustHouseStructure to HouseStructure, and implement structure generation for plains biomes. Updated textures for the subtle knife and omelet items and the house structure should now generate.
Signed-off-by: dragonruler1000 <github@me.minecraftchest2.us>
This commit is contained in:
parent
5a27c4ab2e
commit
3085bd5d92
9 changed files with 89 additions and 9 deletions
|
@ -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.2
|
||||
mod_version=1.2.3
|
||||
# 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
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
//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<ItemStack> 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));
|
||||
// }
|
||||
//}
|
|
@ -25,6 +25,8 @@ public class ModWorldEvents {
|
|||
ObfuscationReflectionHelper.findMethod(ChunkGenerator.class, "func_230347_a_");
|
||||
ResourceLocation cgRL = Registry.CHUNK_GENERATOR_CODEC.getKey(
|
||||
(Codec<? extends ChunkGenerator>)GETCODEC_METHOD.invoke(serverWorld.getChunkProvider().generator));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
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<Biome> key = RegistryKey.getOrCreateKey(Registry.BIOME_KEY, event.getName());
|
||||
Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes(key);
|
||||
|
||||
if(types.contains(BiomeDictionary.Type.PLAINS)) {
|
||||
List<Supplier<StructureFeature<?, ?>>> structures = event.getGeneration().getStructures();
|
||||
|
||||
structures.add(() -> ModStructures.HOUSE.get().withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ 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.DustHouseStructure;
|
||||
import us.minecraftchest2.hdm_mod.world.structure.structures.HouseStructure;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -22,7 +22,7 @@ public class ModStructures {
|
|||
DeferredRegister.create(ForgeRegistries.STRUCTURE_FEATURES, Hdm_mod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Structure<NoFeatureConfig>> HOUSE =
|
||||
STRUCTURES.register("house", DustHouseStructure::new);
|
||||
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*/
|
||||
|
|
|
@ -21,12 +21,12 @@ 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;
|
||||
import us.minecraftchest2.hdm_mod.Hdm_mod;
|
||||
|
||||
public class DustHouseStructure extends Structure<NoFeatureConfig> {
|
||||
public DustHouseStructure() {
|
||||
public class HouseStructure extends Structure<NoFeatureConfig> {
|
||||
public HouseStructure() {
|
||||
super(NoFeatureConfig.CODEC);
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class DustHouseStructure extends Structure<NoFeatureConfig> {
|
|||
|
||||
@Override
|
||||
public IStartFactory<NoFeatureConfig> getStartFactory() {
|
||||
return DustHouseStructure.Start::new;
|
||||
return HouseStructure.Start::new;
|
||||
}
|
||||
|
||||
public static class Start extends StructureStart<NoFeatureConfig> {
|
Binary file not shown.
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 308 B |
Binary file not shown.
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 230 B |
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "tutorialmod:house/start_pool",
|
||||
"name": "hdm_mod:house/start_pool",
|
||||
"fallback": "minecraft:empty",
|
||||
"elements": [
|
||||
{
|
||||
"weight": 1,
|
||||
"element": {
|
||||
"location": "tutorialmod:house",
|
||||
"location": "hdm_mod:house",
|
||||
"processors": "minecraft:empty",
|
||||
"projection": "rigid",
|
||||
"element_type": "minecraft:single_pool_element"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue