mirror of
https://github.com/dragonruler1000/hdm-mod.git
synced 2025-06-29 08:29:33 -05:00
Introduce dimensional event handling and improve loot table configuration
Added `ModWorldEvents` class to manage custom dimensional events and ensure proper spacing in server world generation. Enhanced block_of_dust loot table with weighted drop chances and refined access transformer configuration in `build.gradle`. Integrated structure setup initialization in pre-loading event. Signed-off-by: dragonruler1000 <github@me.minecraftchest2.us>
This commit is contained in:
parent
bcd5a40813
commit
5a27c4ab2e
4 changed files with 40 additions and 2 deletions
|
@ -31,6 +31,7 @@ minecraft {
|
||||||
// Use non-default mappings at your own risk. They may not always work.
|
// 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.
|
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
mappings channel: mapping_channel, version: mapping_version
|
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.
|
// 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.
|
// In most cases, it is not necessary to enable.
|
||||||
|
|
|
@ -67,6 +67,10 @@ public class Hdm_mod {
|
||||||
// some preinit code
|
// some preinit code
|
||||||
LOGGER.info("HELLO FROM PREINIT");
|
LOGGER.info("HELLO FROM PREINIT");
|
||||||
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
|
||||||
|
|
||||||
|
event.enqueueWork(() ->{
|
||||||
|
ModStructures.setupStructures();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doClientStuff(final FMLClientSetupEvent event) {
|
private void doClientStuff(final FMLClientSetupEvent event) {
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
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<? extends ChunkGenerator>)GETCODEC_METHOD.invoke(serverWorld.getChunkProvider().generator));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,7 +6,9 @@
|
||||||
"entries": [
|
"entries": [
|
||||||
{
|
{
|
||||||
"type": "minecraft:item",
|
"type": "minecraft:item",
|
||||||
"name": "hdm_mod:dust"
|
"name": "hdm_mod:dust",
|
||||||
|
"weight": 4,
|
||||||
|
"quality": 9
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue