-
Posts
408 -
Joined
-
Last visited
Posts posted by winnetrie
-
-
Because i'm trying to code correctly as much as i can and not using the "common proxy" approach, but instead with an IProxy interface i was wondering how i register the renders correctly?
I assume i register them directly in the clientproxy class.
I used before a common proxy and an IHasModel interface, perhaps many of you know about this approach. But because i use the IProxy inteface approach, all that doesn't make sense anymore.
Also because of 1.13, i also skip using metadata for blocks with for example different colors.
So do i just register the render in the clientproxy, perhaps with a list?
-
9 hours ago, DaemonUmbra said:
Could you provide your workspace as a GitHub Repo?
Can't do that right now, mainly because i'm not familiar with github and i do not know how to use it correctly and how it works.
Besides that, i figured it out what the problem was. I don't know exactly what the issue was, but something was wrong with my workspace. I made a fresh 1 and all goes well now. Thank you anyway.
-
Funny….Why are people still modding for 1.7.10. It's like if microsoft keeps adding content for windows 95.....
Goto 1.12.2 at least, maybe better 1.13.2
-
Here is a debug log: https://pastebin.com/LVcavFY2
I also uploaded the file.
I don't understand why it gives a proxy error. I can't imagine all those mods are bad coded, and even if they are they work properly in a normal evironment.
So it has to be something wrong on my side.
This is my main class:
package com.winnetrie.wie; import com.winnetrie.wie.proxy.IProxy; import com.winnetrie.wie.util.References; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid = References.MOD_ID, name = References.NAME, version = References.VERSION) public class Wiemod { @Instance public static Wiemod instance; @SidedProxy(clientSide = References.CLIENT_PROXY_CLASS, serverSide = References.SERVER_PROXY_CLASS) public static IProxy proxy; @EventHandler public void PreInit(FMLPreInitializationEvent event) { //entities & networking } @EventHandler public void Init(FMLInitializationEvent event) { //registry events } @EventHandler public void PostInit(FMLPostInitializationEvent event) { //inter-mod stuff } @EventHandler public void serverStarting(FMLServerStartingEvent event) { //server commands registering } }
the interface:
package com.winnetrie.wie.proxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; public interface IProxy { //entities & networking void PreInit(FMLPreInitializationEvent event); //registry events void Init(FMLInitializationEvent event); //inter-mod stuff void PostInit(FMLPostInitializationEvent event); //server commands registering void ServerStarting(FMLServerStartingEvent event); }
the client class:
package com.winnetrie.wie.proxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; public class ClientProxy implements IProxy{ @Override public void PreInit(FMLPreInitializationEvent event) { // TODO Auto-generated method stub } @Override public void Init(FMLInitializationEvent event) { // TODO Auto-generated method stub } @Override public void PostInit(FMLPostInitializationEvent event) { // TODO Auto-generated method stub } @Override public void ServerStarting(FMLServerStartingEvent event) { // TODO Auto-generated method stub } }
the server class:
package com.winnetrie.wie.proxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; public class ServerProxy implements IProxy{ @Override public void PreInit(FMLPreInitializationEvent event) { // TODO Auto-generated method stub } @Override public void Init(FMLInitializationEvent event) { // TODO Auto-generated method stub } @Override public void PostInit(FMLPostInitializationEvent event) { // TODO Auto-generated method stub } @Override public void ServerStarting(FMLServerStartingEvent event) { // TODO Auto-generated method stub } }
and also a reference class:
package com.winnetrie.wie.util; public class References { public static final String MOD_ID = "wie"; public static final String NAME = "Winnetrie's Immersive Expansion"; public static final String VERSION = "1.0"; public static final String ACCEPTED_VERSIONS = "[1.12.2]"; public static final String CLIENT_PROXY_CLASS = "com.winnetrie.wie.proxy.ClientProxy"; public static final String SERVER_PROXY_CLASS = "com.winnetrie.wie.proxy.ServerProxy"; }
I also added the crashreport file
-
No i wasn't going to use their classes (yet) , i only wanted to add them to the game. Just like you would do when you play modded minecraft.
For now every mod i add crashes.
For example this: An error occurred trying to load a proxy into biomesoplenty.core.BiomesOPlenty.proxy
java.lang.ClassNotFoundException: biomesoplenty.core.ClientProxy -
I want to add some other mods to my dev environment. I placed them in the …\run\mods folder.
Now every mod i add failed to construct and throwing a bunch of java.lang.NoClassDefFoundError.
I tried a deobfuscated version , but that gives me the same errors.
-
What's the point to use mc 1.10.2? You should start straight away with 1.12.2. The 1.13 update is almost released.
-
I hope i'm doing this right. I changed the code and tested it. Everything is working fine. I even have a feeling it's working better (more accurately).
public void generateOverworld(World world, Random rand, int x, int z){ int XX = x * 16; int ZZ = z * 16; BlockPos pos = new BlockPos(XX, 70, ZZ); Biome biome = world.getBiome(pos); if (ConfigHandler.enable_limestone_gen == true) { if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER)) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.limestone_gen_chance * 2, 45, 65, BlockMatcher.forBlock(Blocks.STONE)); } if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN)) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 15, 33, ConfigHandler.limestone_gen_chance, 10, 50, BlockMatcher.forBlock(Blocks.STONE)); } } if ((ConfigHandler.enable_marblestone_gen == true) && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.HILLS)) || (BiomeDictionary.hasType(biome, BiomeDictionary.Type.MOUNTAIN))) { generateOre(BlockInit.MARBLESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.marblestone_gen_chance, 65, 256, BlockMatcher.forBlock(Blocks.STONE)); } }
Please don't say this is wrong.....:-)
-
3 minutes ago, diesieben07 said:
You should be using BiomeDictionary instead of random string checks.
Oh yes ofcourse i totally forgot about that!
-
I added this line:
biome = biome.replace("minecraft:", "");
Keeping this for now
-
I have changed it to this:
public void generateOverworld(World world, Random rand, int x, int z){ int XX = x * 16; int ZZ = z * 16; BlockPos pos = new BlockPos(XX, 70, ZZ); String biome = world.getBiome(pos).getRegistryName().toString().toLowerCase(); System.out.println("Trying to generate in: "+ biome); if (ConfigHandler.enable_limestone_gen == true) { if (biome.contains("river")) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.limestone_gen_chance * 2, 45, 65, BlockMatcher.forBlock(Blocks.STONE)); } if (biome.contains("ocean")) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 15, 33, ConfigHandler.limestone_gen_chance, 10, 50, BlockMatcher.forBlock(Blocks.STONE)); } } if ((ConfigHandler.enable_marblestone_gen == true) && ((biome.contains("hills")) || (biome.contains("mountain")))) { generateOre(BlockInit.MARBLESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.marblestone_gen_chance, 65, 256, BlockMatcher.forBlock(Blocks.STONE)); } }
Maybe not the best way. because the var biome contains also the mod id or in this case it has "minecraft:biomename"
-
On my git i saw someone reporting a crash that happens only server sided:
java.lang.NoSuchMethodError: net.minecraft.world.biome.Biome.func_185359_l()Ljava/lang/String;
Is this maybe a clientside only method? The function is getBiomeName()
What should i use instead?
-
Aha this alphabetical order does make sense. I didn't think of that. I was wondering why it behaved so illogical. Perhaps i will use IStateMapper.
I used it once before. I had this issue multiple times before and switching the variants place fixed it, but never understood why.
Good to know. Thank you.
-
I have had some troubles with blockstates in the past and when you think you got it all, the suddenly a weird bug appears.
I have 2 slabclasses 1 for 16 color blocks and 1 for some stone blocks.
They have both 2 variants. The color slab has HALF and COLOR. The stoneslab class has HALF and VARIANT
I had both coded both more or less the way the main issue is in the rendering method here:
for color slab:
@Override public void registerModels() { if (!isDouble()) { Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "color=white,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 1, "color=orange,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 2, "color=magenta,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 3, "color=light_blue,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 4, "color=yellow,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 5, "color=lime,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 6, "color=pink,half=bottom"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 7, "color=gray,half=bottom"); } }
and for the stone slab:
@Override public void registerModels() { if (!isDouble()) { Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "half=bottom,variant=limestone_raw"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 1, "half=bottom,variant=marblestone_raw"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 2, "half=bottom,variant=limestone_cobble"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 3, "half=bottom,variant=marblestone_cobble"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 4, "half=bottom,variant=limestone_brick"); Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 5, "half=bottom,variant=marblestone_brick"); } }
Now you can see that the color slab has set the "color" variant first and then the "half" variant
The stone class has it vica versa. I had it first in the same order has the color slab class but then i got those errors in the console it can't find an item model. Swapping the variant here solved the problem.
Yet i don't understand why. Here are both blockstate files.
For the terracotta brick slabs (part1):
{ "forge_marker": 1, "defaults": { "textures": { "top": "#all", "bottom": "#all", "side": "#all" } }, "variants": { "half": { "bottom": { "model": "minecraft:half_slab" }, "top": { "model": "minecraft:upper_slab" } }, "color": { "white": { "textures": { "all": "tem:blocks/terracotta_white_brick" } }, "orange": { "textures": { "all": "tem:blocks/terracotta_orange_brick" } }, "magenta": { "textures": { "all": "tem:blocks/terracotta_magenta_brick" } }, "light_blue": { "textures": { "all": "tem:blocks/terracotta_light_blue_brick" } }, "yellow": { "textures": { "all": "tem:blocks/terracotta_yellow_brick" } }, "lime": { "textures": { "all": "tem:blocks/terracotta_lime_brick" } }, "pink": { "textures": { "all": "tem:blocks/terracotta_pink_brick" } }, "gray": { "textures": { "all": "tem:blocks/terracotta_gray_brick" } } } } }
and here the stoneslabs:
{ "forge_marker": 1, "defaults": { "textures": { "top": "#all", "bottom": "#all", "side": "#all" } }, "variants": { "half": { "bottom": { "model": "minecraft:half_slab" }, "top": { "model": "minecraft:upper_slab" } }, "variant": { "limestone_raw": { "textures": { "all": "tem:blocks/limestone_smooth_top" } }, "marblestone_raw": { "textures": { "all": "tem:blocks/marblestone_smooth_top" } }, "limestone_cobble": { "textures": { "all": "tem:blocks/limestone_cobble" } }, "marblestone_cobble": { "textures": { "all": "tem:blocks/marblestone_cobble" } }, "limestone_brick": { "textures": { "all": "tem:blocks/limestone_brick" } }, "marblestone_brick": { "textures": { "all": "tem:blocks/marblestone_brick" } } } } }
As you can see the are structured identical
Perhaps there is something i don't see yet.
-
Yes i want to add a new color. There are more then 16 colors defined. If you go look in the mapColor class, you'll see 51 defined colors.
I mean the array COLORS have 51 colors defined, so there are 12 more free slots to define.
I found a solution.
-
How do i make a custom mapColor? I cannot add a new mapcolor because it is private. I can also not extend on mapColor.
-
That looks like a lot of work for something small. I will set it manually for now!
-
15 minutes ago, Draco18s said:
I'm sorry, but i fail to see or understand how this is usefull to me and how i even should use this.
-
Ok i have no idea how to create this "fake" world. How do i do this?
-
Alright i have added this in my class now:
@Override public float getExplosionResistance(World world, BlockPos pos, @Nullable Entity exploder, Explosion explosion) { return this.modelBlock.getExplosionResistance(world, pos, exploder, explosion); } @Override public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { return this.modelState.getBlockHardness(worldIn, pos); } @Override public SoundType getSoundType(IBlockState state, World world, BlockPos pos, @Nullable Entity entity) { return this.modelBlock.getSoundType(state, world, pos, entity); }
It all works and no errors. I also deleted those setters in the constructor ofcourse.
I hope this is how it should be done.
-
So this is how my constructor looks like for my slabs class:
public static final PropertyEnum<BlockBaseSlabColoredA.EnumType> COLOR = PropertyEnum.<BlockBaseSlabColoredA.EnumType>create("color", BlockBaseSlabColoredA.EnumType.class); private final Block modelBlock; private final IBlockState modelState; public BlockBaseSlabColoredA(String name, IBlockState state) { super(state.getMaterial()); this.modelBlock = state.getBlock(); this.modelState = state; IBlockState iblockstate = this.blockState.getBaseState().withProperty(COLOR, BlockBaseSlabColoredA.EnumType.WHITE); if(!this.isDouble()){ iblockstate = iblockstate.withProperty(HALF, EnumBlockHalf.BOTTOM).withProperty(COLOR, BlockBaseSlabColoredA.EnumType.WHITE); } this.setDefaultState(iblockstate); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.BUILDING_BLOCKS); setHardness(this.modelState.getBlockHardness(null, null)); setResistance(this.modelBlock.getExplosionResistance(null, null, null, null)); setSoundType(this.modelBlock.getSoundType(null, null, null, null)); setHarvestLevel(this.modelBlock.getHarvestTool(state), this.modelBlock.getHarvestLevel(state)); setLightLevel(0.0F); this.useNeighborBrightness = true; BlockInit.BLOCKS.add(this); }
As you can see i have alot of "null" here. I guess i should not do this, but how do i get all these arguments?
-
While it is a pleasure to help each other, we also want you to think for yourself.
It can't be that hard to read this line:
QuoteCaused by: net.minecraftforge.fml.common.MissingModsException: Mod eleccore (ElecCore) requires [Forge@[12.18.3.2239,)]
It litterally tells you the cause of the crash and why and how to fix it.
-
1
-
-
Oh right i see. I changed it to this:
@Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { //return ((BlockBaseSlabColoredA.EnumType)state.getValue(COLOR)).getMapColor(); //return this.modelBlock.getMapColor(modelBlock.getDefaultState(), null, null); return this.modelState.getMapColor(null, null); }
I'm putting "null" for both arguments. I'm not sure this is right, but it feels wrong to enter an IBlockAccess and a BlockPos here.
-
I made many variations of existing vanilla blocks and therefore i have an IBlockState argument in my constructor in each class.
For example for stairs and slabs you need to know on what block it is based. So i made a var called modelBlock wich i declare as "modelBlock = state.getBlock();
I use this also to get the mapcolor for the block:
@Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { //return ((BlockBaseSlabColoredA.EnumType)state.getValue(COLOR)).getMapColor(); return this.modelBlock.getMapColor(modelBlock.getDefaultState(), null, null); }
I used another aproach before, wich i commented out. I wanted to have a more/ better approach.
I wonder if this is a good approach since it looks like this
getMapColor:return this.modelBlock.
getMapColor(modelBlock.getDefaultState(), null, null);
MC 1.12.2 block hardness
in Modder Support
Posted
I made colored clay blocks this is the class:
I assigned the same material as for the minecraft clayblock and the same hardness, still my block seems te be harder as the vanilla 1? How is this posseble?