Jump to content

Recommended Posts

Posted

How would I override vanilla block properties? For example, decrease obsidian blast resistance, make cobble a falling block, make wool inflammable, etc. Blocks.OBSIDIAN etc are final values and cannot be directly modified.

 

Also is it possible to modify wool and other colored block properties without manually entering each wool color in an array and parsing through etc?

Posted
3 hours ago, Asleep365 said:

How would I override vanilla block properties?

you have to create a normal block but you have to register it with the minecraft id

public static final DeferredRegister<Item> VANILLA_ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Minecraft_Id);

public static final RegistryObject<Item> SUGAR = VANILLA_ITEMS.register("sugar", Sugar::new);


package net.luis.cave.items.vanilla;

import net.minecraft.item.Food;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;

public class Sugar extends Item {

	@SuppressWarnings("deprecation")
	public Sugar() {
		
		super(new Item.Properties()
				.group(ItemGroup.FOOD)
				.food(new Food.Builder()
						.hunger(2)
						.saturation(1.0f)
						.effect(new EffectInstance(Effects.SPEED, 300, 3), 1)
						.setAlwaysEdible()
						.build()));
	}

}

 

this is my overwriting of sugar, but it works also with blocks (you have to change ForgeRegistries)

Posted

I haven't been able to get this to work. A sample of my code is below:

 

public static final DeferredRegister<Block> VANILLA_BLOCKS = new DeferredRegister(ForgeRegistries.BLOCKS, "minecraft");

//Overwrite vanilla items
public static final RegistryObject<Block> DIRT = registerVanillaBuildingBlockWithDefaultItem(
        "dirt",
        () -> new NewDirtBlock());

public static final RegistryObject<Block> DIRTTEST = registerBlockWithDefaultItem(
        "dirttest",
        () -> new NewDirtBlock());

public static <T extends Block> RegistryObject<T> registerBlockWithDefaultItem(String name, Supplier<? extends T>blockSupplier)
{
    RegistryObject<T> block = BLOCKS.register(name, blockSupplier);
    ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().group(ModItems.solidarityGroup)));
    return block;
}

public static <T extends Block> RegistryObject<T> registerVanillaBuildingBlockWithDefaultItem(String name, Supplier<? extends T>blockSupplier)
{
    RegistryObject<T> block = VANILLA_BLOCKS.register(name, blockSupplier);
    ModItems.VANILLA_ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)));
    return block;
}

 

NewDirtBlock():

public class NewDirtBlock extends FallingBlock {
    private final BlockState solidifiedState;

    public NewDirtBlock() {
        super(Block.Properties.create(Material.EARTH, MaterialColor.DIRT).hardnessAndResistance(0.5F).sound(SoundType.GROUND));
        this.solidifiedState = ModBlocks.MUD.get().getDefaultState();
    }
    ...
}

 

ModItems.VANILLA_ITEMS:

public static final DeferredRegister<Item> VANILLA_ITEMS = new DeferredRegister(ForgeRegistries.ITEMS, "minecraft");

 

When registered under "dirttest", the properties all function as intended. However, when registered under "minecraft:dirt" it only seems to have vanilla dirt properties (doesn't fall, convert to mud etc). What is wrong with the above code?

Posted
7 hours ago, Asleep365 said:

When registered under "dirttest", the properties all function as intended. However, when registered under "minecraft:dirt" it only seems to have vanilla dirt properties (doesn't fall, convert to mud etc). What is wrong with the above code?

first my code example is from 1.16 but I think it works also in 1.15.2.

your code looks okay, unfortunately I can't tell you where the error is.

but i have an idea where the mistake is,

can you show your mod class constructor.

  • Like 1
Posted
@Mod(Solidarity.MOD_ID)
public class Solidarity
{
    public static final String MOD_ID = "solidarity";

    private static final Logger LOGGER = LogManager.getLogger();

    public static IEventBus MOD_EVENT_BUS;

    public Solidarity() {
        MinecraftForge.EVENT_BUS.register(this);

        MOD_EVENT_BUS = FMLJavaModLoadingContext.get().getModEventBus();

        ModBlocks.BLOCKS.register(MOD_EVENT_BUS);
        ModItems.ITEMS.register(MOD_EVENT_BUS);
        ModTileEntities.TILE_ENTITY_TYPES.register(MOD_EVENT_BUS);
        ModContainers.CONTAINERS.register(MOD_EVENT_BUS);
        ModRecipeSerializers.RECIPE_SERIALIZERS.register(MOD_EVENT_BUS);

        DistExecutor.runWhenOn(Dist.CLIENT, () -> Solidarity::registerClientOnlyEvents);
    }

 

Removed comments to conserve space. Have a feeling you're probably right, I don't have a ModBlocks.VANILLA_BLOCKS etc. I'm guessing it'll need a different MOD_EVENT_BUS?

Posted
10 hours ago, Asleep365 said:

Removed comments to conserve space. Have a feeling you're probably right, I don't have a ModBlocks.VANILLA_BLOCKS etc. I'm guessing it'll need a different MOD_EVENT_BUS?

you can use the normal one

Posted (edited)

It seems like replacing vanilla blocks causes the world generation to bug out. The world generation occurs like normal except all the dirt is invisible, solid, but cannot be punched. Lighting updates proceed as if they weren't there. Placing a block where there should be dirt has a no-texture block, F3 says it's "minecraft:air".

 

Strangely, it works fine in super-flat worlds, so I might have to overwrite the dirt generation to also to use the custom dirt.

2021-02-14.png

 

EDIT: Leaving the area and coming back causes all glitched blocks to be replaced with normal, "real" air, no lighting glitches like above

EDIT2: NVM that was just my night vision potion, lighting still glitched, but not solid anymore

Edited by Asleep365
Posted (edited)
10 hours ago, Asleep365 said:

I might have to overwrite the dirt generation to also to use the custom dirt.

I think yes, but I have no idea how you do it exactly.

what you can try is to creat a ore generate and use vanilla dirt as a filler block

 

Edit: what is also possible is to create a dirt block that extends the vanilla dirt (does not overwrite). which has your desired properties, and then generate them in the world instead of vanilla dirt

Edited by Luis_ST
Posted

From research it might be possible to replace the dirt after generation when loading new chunks. Something like this maybe: 

 

 

 

My problem however is a bit more complicated. In addition to changing the vanilla dirt properties, I also have "dirt ores" that replace dirt. If the vanilla dirt generation occurs in the RAW_GENERATION stage, and the "dirt ores" generate in the UNDERGROUND_ORE phase, there isn't much extra room to replace vanilla dirt with the custom dirt.

Posted (edited)

Okay, I got my replacement function working "correctly", in the sense that I can replace a block with another on world generation, using something similar to the one I linked. The problem now is that neither replacing Blocks.AIR or Blocks.DIRT replace the missing, glitched blocks. I'll try some functions to identify the "block type" of one of the glitched blocks

 

EDIT: System.out.println() says the block is "Block{minecraft:dirt}", but equality (==) comparisons of the block to Blocks.DIRT, ModBlocks.DIRT.get(), and Blocks.AIR all return false. Have no idea what the block really is

Edited by Asleep365
Posted
9 hours ago, Asleep365 said:

Okay, I got my replacement function working "correctly", in the sense that I can replace a block with another on world generation, using something similar to the one I linked. The problem now is that neither replacing Blocks.AIR or Blocks.DIRT replace the missing, glitched blocks. I'll try some functions to identify the "block type" of one of the glitched blocks

I think the problem is you want to replace the minecraft dirt with itself I think the best and the most uncomplicated

would be you register the dirt with your mod id and then try to replace it again

I'm not sure because I'm not very familiar with ore generating, but I think minecraft checks whether the block is dirt instance of DirtBlock, which is not the case with you

Posted (edited)

The problem with having a separate block is that when grass dies, hoe'd dirt is trampled, and any modded recipes or interactions etc I need it to turn into the custom dirt. Even if I were to change every dirt related block I can't change the recipes in other mods.

 

Note that grass and other dirt variants not being replaced is intended behavior. I just need to find what the glitched blocks are an instance of, or be able to extract some unique property that only exists in minecraft:dirt

Edited by Asleep365
Posted (edited)
7 hours ago, Asleep365 said:

Note that grass and other dirt variants not being replaced is intended behavior. I just need to find what the glitched blocks are an instance of, or be able to extract some unique property that only exists in minecraft:dirt

try minecraft:cave_air or minecraft:void

 

Edit: what is also possible is you overwrite the vanilla dirt block (the blockitem) so that every time you place vanilla dirt.

your dirt will be placed and every time you break down your dirt block it will drop vanilla dirt.

Edited by Luis_ST
Posted (edited)

I don't think cave_air would be practical since it would fill in all the caves with dirt. I could try void, but since I'm also planning on replacing cobblestone it wouldn't be a long term solution even if it worked.

 

Part of my reasoning for the falling dirt is 1. an additional environmental hazard, 2. being a fundamentally different material for construction. Replacing the item alone would only solve number 2.

 

Falling cobble is similar, biggest thing I need to worry about is the roofs of plains village temples and jungle temples.

 

If the System.out.println(block) or blockstate thinks it's dirt, there has to be some way to check in code whether it is dirt.

 

EDIT: Thought of an idea, if System.out.println() identifies correctly, what if I just use block.toString() and compare that to Block{minecraft:dirt}? Probably not the best solution, but it might work

Edited by Asleep365
Posted (edited)

Using string.equals() comparison works, as long as it occurs after all dirt is successfully generated. Will need a few modifications to instead generate mud in rivers and oceans, but for the most part doesn't have significant issues. I'll probably need to update Seagrass, and sugarcane to grow on mud also as mud doesn't have a solid topside. Going to leave kelp out since kelp attaches to rocks, and doesn't have roots.

 

Unfortunately I can't find any documentation on worldgen stages. I need a stage to generate the dirt that still has another stage after it to generate dirt ores. Should occur after UNDERGROUND_STRUCTURES preferably to ensure mineshafts generate correctly. Preferably not VEGETAL_DECORATIONS as that seems to prevent the spawning of seagrass and other plants. The generation stages are: VEGETAL_DECORATION, UNDERGROUND_DECORATION, UNDERGROUND_ORES, RAW_GENERATION, LOCAL_MODIFICATIONS, SURFACE_STRUCTURES, TOP_LAYER_MODIFICATIONS, UNDERGROUND_STRUCTURES. Setting it in RAW_GENERATION still results in some bugged blocks (presumably dirt generated after RAW_GENERATION). VEGETAL_DECORATION results in plants etc that would be generated on dirt don't generate.

 

Simplest solution would be if I could make a custom worldgen stage post-generation to replace all dirt, cobble, seagrass, sugarcane, and whatever else I may need (coral etc). After that, another worldgen stage to replace some dirt with dirt ores. If this is possible with a custom world type that would be acceptable as well.

 

EDIT: Plants actually generate correctly. Should potentially be fairly straight forward then, just need to make sure I don't miss any stages of generation

Edited by Asleep365
Posted
7 hours ago, Asleep365 said:

I'll probably need to update Seagrass, and sugarcane to grow on mud

I'm not sure, but I think that is also possible with the tag forge:dirt

 

7 hours ago, Asleep365 said:

Unfortunately I can't find any documentation on worldgen stages.

I am unfortunately not familiar with that. Sorry I can't help you any further

 

if you need help with the world generation have a look in the forum or create a new topic

  • 3 years later...
Posted

I i know this thread is old but would you know what is wrong with my code for it not to work:

 

public static final DeferredRegister<Block> VANILLA_ITEMS = DeferredRegister.create(ForgeRegistries.BLOCKS, "minecraft");

public static final RegistryObject<Block> OAK_LOG = VANILLA_ITEMS.register("oak_log",
            () -> new Block(BlockBehaviour.Properties.of().strength(5.0f, 0.5f)));

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I've been trying to find a solution for this for the past few days and cant seem to find it anywhere.   What i want to do is basically set my player's head pitch without the server noticing it. Basically client-side change.   Is there a way to do this? With mixins or anything else?   Thanks in advance.
    • Did you ever find a solution to this
    • I have followed a tutorial on how to generate ores for my mod though the data files have not been generated despite me running data in my IDE.  I have looked over and compared my code multiple times and the only differences are either with the IDs or with unnecessary code because of what my mod is (The mod is for the End so I don't need the Overworld or Nether ores), my folders are all in the right structure and no warnings are present when ran. I have been trying to figure this out for a few days now so help would be much appreciated.  The tutorial I was following.  My code -  public class ModBiomeModifiers { public static final ResourceKey<BiomeModifier> ADD_GAZITE_ORE = registerKey("add_gazite_ore"); public static final ResourceKey<BiomeModifier> TRANSCENDINE_GAZITE_ORE = registerKey("add_transcendine_ore"); public static void bootstrap(BootstrapContext<BiomeModifier> context) { var placedFeature = context.lookup(Registries.PLACED_FEATURE); var biomes = context.lookup(Registries.BIOME); context.register(ADD_GAZITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_END), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.GAZITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); context.register(TRANSCENDINE_GAZITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_END), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.TRANSCENDINE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); } private static ResourceKey<BiomeModifier> registerKey(String name) { return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(EchoingEnd.MOD_ID, name)); } } The tutorial's code -  public class ModBiomeModifiers { public static final ResourceKey<BiomeModifier> ADD_ALEXANDRITE_ORE = registerKey("add_alexandrite_ore"); public static final ResourceKey<BiomeModifier> ADD_NETHER_ALEXANDRITE_ORE = registerKey("add_nether_alexandrite_ore"); public static final ResourceKey<BiomeModifier> ADD_END_ALEXANDRITE_ORE = registerKey("add_end_alexandrite_ore"); public static void bootstrap(BootstrapContext<BiomeModifier> context) { var placedFeature = context.lookup(Registries.PLACED_FEATURE); var biomes = context.lookup(Registries.BIOME); context.register(ADD_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_OVERWORLD), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.ALEXANDRITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); // Individual Biomes // context.register(ADD_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( // HolderSet.direct(biomes.getOrThrow(Biomes.PLAINS), biomes.getOrThrow(Biomes.BAMBOO_JUNGLE)), // HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.ALEXANDRITE_ORE_PLACED_KEY)), // GenerationStep.Decoration.UNDERGROUND_ORES)); context.register(ADD_NETHER_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_NETHER), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.NETHER_ALEXANDRITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); context.register(ADD_END_ALEXANDRITE_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_END), HolderSet.direct(placedFeature.getOrThrow(ModPlacedFeatures.END_ALEXANDRITE_ORE_PLACED_KEY)), GenerationStep.Decoration.UNDERGROUND_ORES)); } private static ResourceKey<BiomeModifier> registerKey(String name) { return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, name)); } }   ModConfiguredFeatures:   My code -  public class ModConfiguredFeatures { public static final ResourceKey<ConfiguredFeature<?, ?>> GAZITE_ORE_KEY = registerKey("gazite_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> TRANSCENDINE_ORE_KEY = registerKey("transcendine_ore"); public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) { RuleTest endReplaceables = new BlockMatchTest(Blocks.END_STONE); register(context, GAZITE_ORE_KEY, Feature.ORE, new OreConfiguration(endReplaceables, ModBlocks.GAZITE_ORE.get().defaultBlockState(), 4)); register(context, TRANSCENDINE_ORE_KEY, Feature.ORE, new OreConfiguration(endReplaceables, ModBlocks.TRANSCENDINE_ORE.get().defaultBlockState(), 8)); List<OreConfiguration.TargetBlockState> EndOres = List.of( OreConfiguration.target(endReplaceables, ModBlocks.GAZITE_ORE.get().defaultBlockState()), OreConfiguration.target(endReplaceables, ModBlocks.TRANSCENDINE_ORE.get().defaultBlockState())); } public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) { return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(EchoingEnd.MOD_ID, name)); } private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) { context.register(key, new ConfiguredFeature<>(feature, configuration)); } }   The tutorial's code - public class ModConfiguredFeatures { public static final ResourceKey<ConfiguredFeature<?, ?>> OVERWORLD_ALEXANDRITE_ORE_KEY = registerKey("alexandrite_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> NETHER_ALEXANDRITE_ORE_KEY = registerKey("nether_alexandrite_ore"); public static final ResourceKey<ConfiguredFeature<?, ?>> END_ALEXANDRITE_ORE_KEY = registerKey("end_alexandrite_ore"); public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) { RuleTest stoneReplaceables = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); RuleTest deepslateReplaceables = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); RuleTest netherrackReplaceables = new BlockMatchTest(Blocks.NETHERRACK); RuleTest endReplaceables = new BlockMatchTest(Blocks.END_STONE); List<OreConfiguration.TargetBlockState> overworldAlexandriteOres = List.of( OreConfiguration.target(stoneReplaceables, ModBlocks.ALEXANDRITE_ORE.get().defaultBlockState()), OreConfiguration.target(deepslateReplaceables, ModBlocks.ALEXANDRITE_DEEPSLATE_ORE.get().defaultBlockState())); register(context, OVERWORLD_ALEXANDRITE_ORE_KEY, Feature.ORE, new OreConfiguration(overworldAlexandriteOres, 9)); register(context, NETHER_ALEXANDRITE_ORE_KEY, Feature.ORE, new OreConfiguration(netherrackReplaceables, ModBlocks.ALEXANDRITE_NETHER_ORE.get().defaultBlockState(), 9)); register(context, END_ALEXANDRITE_ORE_KEY, Feature.ORE, new OreConfiguration(endReplaceables, ModBlocks.ALEXANDRITE_END_ORE.get().defaultBlockState(), 9)); } public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) { return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, name)); } private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) { context.register(key, new ConfiguredFeature<>(feature, configuration)); } }   ModPlacedFeatures:   My code - public class ModPlacedFeatures { public static final ResourceKey<PlacedFeature> GAZITE_ORE_PLACED_KEY = registerKey("gazite_ore_placed"); public static final ResourceKey<PlacedFeature> TRANSCENDINE_ORE_PLACED_KEY = registerKey("transcendine_ore_placed"); public static void bootstrap(BootstrapContext<PlacedFeature> context) { var configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); register(context, GAZITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.GAZITE_ORE_KEY), ModOrePlacement.commonOrePlacement(9, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(71)))); register(context, TRANSCENDINE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.GAZITE_ORE_KEY), ModOrePlacement.rareOrePlacement(6, HeightRangePlacement.uniform(VerticalAnchor.absolute(-32), VerticalAnchor.absolute(71)))); } private static ResourceKey<PlacedFeature> registerKey(String name) { return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(EchoingEnd.MOD_ID, name)); } private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration, List<PlacementModifier> modifiers) { context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); } }   the tutorial's code -  public class ModPlacedFeatures { public static final ResourceKey<PlacedFeature> ALEXANDRITE_ORE_PLACED_KEY = registerKey("alexandrite_ore_placed"); public static final ResourceKey<PlacedFeature> NETHER_ALEXANDRITE_ORE_PLACED_KEY = registerKey("nether_alexandrite_ore_placed"); public static final ResourceKey<PlacedFeature> END_ALEXANDRITE_ORE_PLACED_KEY = registerKey("end_alexandrite_ore_placed"); public static void bootstrap(BootstrapContext<PlacedFeature> context) { var configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); register(context, ALEXANDRITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.OVERWORLD_ALEXANDRITE_ORE_KEY), ModOrePlacement.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))); register(context, NETHER_ALEXANDRITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.NETHER_ALEXANDRITE_ORE_KEY), ModOrePlacement.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))); register(context, END_ALEXANDRITE_ORE_PLACED_KEY, configuredFeatures.getOrThrow(ModConfiguredFeatures.END_ALEXANDRITE_ORE_KEY), ModOrePlacement.commonOrePlacement(12, HeightRangePlacement.uniform(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))); } private static ResourceKey<PlacedFeature> registerKey(String name) { return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, name)); } private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration, List<PlacementModifier> modifiers) { context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); } }   ModOrePlacement:   My code -  public class ModOrePlacement { public static List<PlacementModifier> orePlacement(PlacementModifier pCountPlacement, PlacementModifier pHeightRange) { return List.of(pCountPlacement, InSquarePlacement.spread(), pHeightRange, BiomeFilter.biome()); } public static List<PlacementModifier> commonOrePlacement(int pCount, PlacementModifier pHeightRange) { return orePlacement(CountPlacement.of(pCount), pHeightRange); } public static List<PlacementModifier> rareOrePlacement(int pChance, PlacementModifier pHeightRange) { return orePlacement(RarityFilter.onAverageOnceEvery(pChance), pHeightRange); } }   The tutorial's code -  public class ModOrePlacement { public static List<PlacementModifier> orePlacement(PlacementModifier pCountPlacement, PlacementModifier pHeightRange) { return List.of(pCountPlacement, InSquarePlacement.spread(), pHeightRange, BiomeFilter.biome()); } public static List<PlacementModifier> commonOrePlacement(int pCount, PlacementModifier pHeightRange) { return orePlacement(CountPlacement.of(pCount), pHeightRange); } public static List<PlacementModifier> rareOrePlacement(int pChance, PlacementModifier pHeightRange) { return orePlacement(RarityFilter.onAverageOnceEvery(pChance), pHeightRange); } }  
    • I'm creating a modpack, and i just discovered that if i try to connect to a server it gives the error: Internal Exception: io.netty.handler.codec.DecoderException: java.lang.negativearraysizeexception -1   The client log:  
    • You just need to run the updated installer like if you were installing a new server. You can overwrite an existing install with a new version.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.