Jump to content

JimiIT92

Members
  • Posts

    867
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JimiIT92

  1. So as by title i have this glitch when trying to breaking a block that has an overlay texture So in the model file i have 2 textures on the same face, the cobblestone texture and a transparent colored texture. With this we got colored cobblestone By the way, is there any way to remove this glitch? This is actually the class i use for this kind of blocks package com.mineworld.blocks.colors; import com.mineworld.core.MWTabs; import net.minecraft.block.Block; import net.minecraft.block.BlockColored; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BlockColoredMW extends BlockColored { public BlockColoredMW(Material mat, float hardness, float resistance) { super(mat); this.setHardness(hardness); this.setResistance(resistance); this.setCreativeTab(MWTabs.tabColorsBlock); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side)); Block block = iblockstate.getBlock(); return block == this ? false : super.shouldSideBeRendered(blockState, blockAccess, pos, side); } } And this is the model file { "parent": "block/block", "textures": { "particle": "#base" }, "elements": [ { "from": [ 0, 0, 0], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "down"}, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "up"}, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "north"}, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "south"}, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "west"}, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#base", "cullface": "east"} } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "down"}, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "up"}, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "north"}, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "south"}, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "west"}, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "cullface": "east"} } } ] } Where base is the texture of the Vanilla block and overlay is the color texture (this are taken from another model file, wich of course is a child of this. An example of this file is this, whit the black cobblestone) { "parent": "mw:block/block_overlay", "textures": { "base": "blocks/cobblestone", "overlay": "mw:blocks/black" } }
  2. Due to the model i think the glitch will still be there even with different material. By now i've solved doing a check in the update tick function, so if the plant is trying to grow up but it's near the surface of water then it stops growing Thanks anyway for the help
  3. Thanks a lot By doing that the plant is rendered good underwater. But when this grows outside it still have this glitch
  4. Changing to that material gives me this error when i place the block java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=level, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]} as it does not exist in BlockStateContainer{block=mw:blue_coral, properties=[age]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:192) at net.minecraft.block.BlockDynamicLiquid.getPossibleFlowDirections(BlockDynamicLiquid.java:226) at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:137) at net.minecraft.block.Block.randomTick(Block.java:552) at net.minecraft.world.WorldServer.updateBlocks(WorldServer.java:480) at net.minecraft.world.WorldServer.tick(WorldServer.java:224) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:768) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) at java.lang.Thread.run(Unknown Source)
  5. I've maded a plant that looks like chorus plant but grows underwater. But, due to it's model, there is a graphical glitch bot underwater or when it grows outside of the water. In this image you can see what i mean. So my question is: is there a way to remove this glitch? Maybe a custom model or something? I've seen some mods that has underwater plants and they don't have this glitch, but they don't have an open source code, so how can i do that? If this needs this are the classes for the plant BlockBlueCoral (the chorus fruit-like block) [url]http://pastebin.com/ZZFvJuMR[/url] BlockBlueCoralPlant (the chorus plant-like block) [url]http://pastebin.com/vqyuqfbk[/url] The json files for models are the same as the chorus plant/flower
  6. Strange, it works in a previous 1.9 version of Forge I'll check this out, thanks for the answer
  7. This happened in Forge 1.9 - 12.16.0.1854 I have some stairs placed upside-down, like this But when i place a stair in the corner than this happen
  8. Thanks Upgrading has solved the problem But i also found a bug wich i'm gonna report in the related section Thanks for the help
  9. GameRegistry only allows me to register blocks, items, fuelhandler, worldgen and tileentity
  10. Thanks for the answer. After generating several worlds it looks like the biome isn't spawing, even if it have a really high weight. Maybe i'm wrong registering it, this is the class i'm using for that package com.mineworld.core; import com.mineworld.world.WorldGenMinableMW; import com.mineworld.world.biomes.BiomeGenAppleForest; import com.mojang.realmsclient.util.RealmsTasks.WorldCreationTask; import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.world.WorldManager; import net.minecraft.world.WorldProvider; import net.minecraft.world.WorldSettings; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeProvider; import net.minecraft.world.gen.ChunkProviderSettings; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.common.BiomeManager.BiomeType; import net.minecraftforge.event.terraingen.ChunkGeneratorEvent; import net.minecraftforge.event.terraingen.WorldTypeEvent; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.registry.GameRegistry; public class MWWorld { public static BiomeGenBase appleForest; //Called by preInit public static void addComponents() { appleForest = new BiomeGenAppleForest(); } //Called by Init public static void registerComponents() { BiomeDictionary.registerBiomeType(appleForest, Type.FOREST); BiomeManager.addSpawnBiome(appleForest); } //Called by postInit public static void addBiomesToWorld() { BiomeManager.addBiome(BiomeType.WARM, new BiomeManager.BiomeEntry(appleForest,1000000000)); BiomeProvider.allowedBiomes.add(appleForest); } } And this is the biome class package com.mineworld.world.biomes; import java.util.Random; import com.mineworld.world.gen.feature.WorldGenAppleTree; import com.mineworld.world.gen.feature.WorldGenBigAppleTree; import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockFlower; import net.minecraft.entity.passive.EntityRabbit; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraft.world.gen.feature.WorldGenBigMushroom; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BiomeGenAppleForest extends BiomeGenBase { protected static final WorldGenAppleTree worldGenAppleTree = new WorldGenAppleTree(false); protected static final WorldGenBigAppleTree worldGenBigAppleTree = new WorldGenBigAppleTree(false); public BiomeGenAppleForest() { super(new BiomeProperties("Apple Forest")); this.theBiomeDecorator.treesPerChunk = 10; this.theBiomeDecorator.grassPerChunk = 2; } public WorldGenAbstractTree genBigTreeChance(Random rand) { return (WorldGenAbstractTree) ((rand.nextInt(10) == 0 ? worldGenBigAppleTree : worldGenAppleTree)); } public void decorate(World worldIn, Random rand, BlockPos pos) { this.decorateBiome(worldIn, rand, pos); super.decorate(worldIn, rand, pos); } public void decorateBiome(World worldIn, Random rand, BlockPos pos) { for (int i = 0; i < 4; ++i) { for (int j = 0; j < 4; ++j) { int k = i * 4 + 1 + 8 + rand.nextInt(3); int l = j * 4 + 1 + 8 + rand.nextInt(3); BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l)); WorldGenAbstractTree worldgenabstracttree = this.genBigTreeChance(rand); worldgenabstracttree.func_175904_e(); if (worldgenabstracttree.generate(worldIn, rand, blockpos)) { worldgenabstracttree.func_180711_a(worldIn, rand, blockpos); } } } } } Is there something wrong with this class? Because otherwise i can't undesrtand why a biome with that high probability of spawning doesn't spawn
  11. So appearently beetroots generated in villages make Forge crash. This is the log given out in eclipse. I was walking in a new generated world and then the game crashed. I'm using Forge version 12.16.0.1767 ---- Minecraft Crash Report ---- // Why is it breaking Time: 05/04/16 17.22 Description: Ticking entity java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=age, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7]} as it does not exist in BlockStateContainer{block=minecraft:beetroots, properties=[age]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:192) at net.minecraft.block.BlockCrops.getDrops(BlockCrops.java:182) at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:640) at net.minecraft.block.BlockCrops.dropBlockAsItemWithChance(BlockCrops.java:205) at net.minecraft.block.Block.dropBlockAsItem(Block.java:630) at net.minecraft.world.World.destroyBlock(World.java:446) at net.minecraft.entity.ai.EntityAIHarvestFarmland.updateTask(EntityAIHarvestFarmland.java:89) at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:111) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:836) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2334) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:630) at net.minecraft.entity.EntityAgeable.onLivingUpdate(EntityAgeable.java:177) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2160) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:343) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2086) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:864) at net.minecraft.world.World.updateEntity(World.java:2051) at net.minecraft.world.World.updateEntities(World.java:1882) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:637) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:779) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) at java.lang.Thread.run(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:192) at net.minecraft.block.BlockCrops.getDrops(BlockCrops.java:182) at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:640) at net.minecraft.block.BlockCrops.dropBlockAsItemWithChance(BlockCrops.java:205) at net.minecraft.block.Block.dropBlockAsItem(Block.java:630) at net.minecraft.world.World.destroyBlock(World.java:446) at net.minecraft.entity.ai.EntityAIHarvestFarmland.updateTask(EntityAIHarvestFarmland.java:89) at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:111) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:836) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2334) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:630) at net.minecraft.entity.EntityAgeable.onLivingUpdate(EntityAgeable.java:177) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2160) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:343) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2086) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:864) at net.minecraft.world.World.updateEntity(World.java:2051) -- Entity being ticked -- Details: Entity Type: Villager (net.minecraft.entity.passive.EntityVillager) Entity ID: 88 Entity Name: Villager Entity's Exact location: 189,55, 70,00, 356,80 Entity's Block location: World: (189,70,356), Chunk: (at 13,4,4 in 11,22; contains blocks 176,0,352 to 191,255,367), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Entity's Momentum: -0,01, -0,08, 0,11 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.world.World.updateEntities(World.java:1882) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:637) -- Affected level -- Details: Level name: New World All players: 1 total; [EntityPlayerMP['Player124'/274, l='New World', x=297,71, y=77,01, z=222,07]] Chunk stats: ServerChunkCache: 626 Drop: 0 Level seed: -3920674869502656299 Level generator: ID 00 - default, ver 1. Features enabled: true Level generator options: Level spawn location: World: (256,64,248), Chunk: (at 0,4,8 in 16,15; contains blocks 256,0,240 to 271,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 325 game time, 325 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 44845 (now: false), thunder time: 103162 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:779) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) at java.lang.Thread.run(Unknown Source) -- System Details -- Details: Minecraft Version: 1.9 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_74, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 201135608 bytes (191 MB) / 904921088 bytes (863 MB) up to 1890582528 bytes (1803 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP 9.23 Powered by Forge 12.16.0.1767 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9-12.16.0.1767-1.9.jar) UCHIJAAAA Forge{12.16.0.1767} [Minecraft Forge] (forgeSrc-1.9-12.16.0.1767-1.9.jar) UCHIJAAAA mw{0.6.1} [MineWorld] (bin) Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Player Count: 1 / 8; [EntityPlayerMP['Player124'/274, l='New World', x=297,71, y=77,01, z=222,07]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge'
  12. Thanks for the quick answer Also is there an easy way to check if a biome has generated in the world? Just to avoid the "exploring world for 20 minutes found nothing so create a new world and see if i find it"?
  13. In 1.8 i used this to let a custom biome spawn in a world without making a new World Type WorldChunkManager.allowedBiomes.add(AppleForest); But in 1.9 i can't find the WorldChunkManager class. So how can i add a custom biome in the world? I'm using the Forge version 12.16.0.1767
  14. Doh, i forgot the change to slot Also i didn't know the "Material name trick" D:
  15. So upgrading Forge to a newer version (when available) will sove the problem? Good to know And thanks for response
  16. When trying to equip custom armor it gives me this error java.io.FileNotFoundException: minecraft:textures/models/armor/ruby_armor_layer_2.png at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:68) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:64) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:34) ~[simpleTexture.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:67) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:42) [TextureManager.class:?] at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:127) [Render.class:?] at net.minecraft.client.renderer.entity.layers.LayerArmorBase.renderArmorLayer(LayerArmorBase.java:65) [LayerArmorBase.class:?] at net.minecraft.client.renderer.entity.layers.LayerArmorBase.doRenderLayer(LayerArmorBase.java:39) [LayerArmorBase.class:?] at net.minecraft.client.renderer.entity.RenderLivingBase.renderLayers(RenderLivingBase.java:456) [RenderLivingBase.class:?] at net.minecraft.client.renderer.entity.RenderLivingBase.doRender(RenderLivingBase.java:196) [RenderLivingBase.class:?] at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:74) [RenderPlayer.class:?] at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:28) [RenderPlayer.class:?] at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:365) [RenderManager.class:?] at net.minecraft.client.gui.inventory.GuiInventory.drawEntityOnScreen(GuiInventory.java:141) [GuiInventory.class:?] at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:814) [GuiContainerCreative.class:?] at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:98) [GuiContainer.class:?] at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:62) [inventoryEffectRenderer.class:?] at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:652) [GuiContainerCreative.class:?] at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:309) [ForgeHooksClient.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1147) [EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1135) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:401) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_74] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_74] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_74] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] and of course a black/purple texture This is my armor class, is this a bug or there's something wrong? package com.mineworld.items; import com.mineworld.MW; import com.mineworld.core.MWItems; import com.mineworld.core.MWTabs; import net.minecraft.entity.Entity; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemArmorMW extends ItemArmor { private String material; public ItemArmorMW(ArmorMaterial par1, EntityEquipmentSlot par3) { super(par1, 0, par3); this.setCreativeTab(MWTabs.tabCombat); this.material = par1.name().toLowerCase(); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if(slot == 2) return MW.MODID + ":" + "textures/models/armor/" + this.material + "_layer_2.png"; else return MW.MODID + ":" + "textures/models/armor/" + this.material + "_layer_1.png"; } @Override public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { if(this.material.equals("ruby_armor") && repair.getItem().equals(MWItems.ruby) || this.material.equals("sapphire_armor") && repair.getItem().equals(MWItems.sapphire) || this.material.equals("copper_armor") && repair.getItem().equals(MWItems.copper_ingot) || this.material.equals("bronze_armor") && repair.getItem().equals(MWItems.copper_ingot) || this.material.equals("silver_armor") && repair.getItem().equals(MWItems.copper_ingot) || this.material.equals("aluminium_armor") && repair.getItem().equals(MWItems.copper_ingot)) return true; else return false; } }
  17. Same to me, was trying to add a custom Axe, but it crashes because of this private static final float[] ATTACK_DAMAGES = new float[] {6.0F, 8.0F, 8.0F, 8.0F, 6.0F}; It takes the damage as an index for that array, not as a value
  18. Appearently from rendering side nothing has changed in both json files and classes
  19. Doesn't work. Also slabs has the same problem
  20. So i was trying to update my stairs from 1.8 but seems something has changed in rendering. This is how they looks if placed upside And this is my stairs code, i've tried adding the isOpaqueCube function but it seems to change nothing package com.mineworld.blocks; import com.mineworld.core.MWTabs; import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; public class BlockStairsMW extends BlockStairs{ public BlockStairsMW(Block block) { this(block.getDefaultState()); } public BlockStairsMW(Block block, int meta) { this(block.getStateFromMeta(meta)); } public BlockStairsMW(IBlockState state) { super(state); this.setHardness(3.0F); this.setResistance(5.0F); if(state.getBlock().getMaterial(state).equals(Material.wood)) this.setStepSound(SoundType.WOOD); else this.setStepSound(SoundType.METAL); this.setCreativeTab(MWTabs.tabBlock); this.setLightOpacity(0); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } }
  21. Yes, overriding that method has solved the problem, thank you!
  22. I'm updating my mod to 1.9, but i've soon noticed an issue with fluids. They are considered as solid blocks, therefore i cannot "dive" in them, i can literaly walk on water This is the code for my fluids (i have 4 of them in the same class) package com.mineworld.fluids; import com.mineworld.MW; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; public class MWFluids { private static ModelResourceLocation corruptedfluidLocation = new ModelResourceLocation(MW.MODID + ":" + CorruptedFluidBlock.name, "fluid"); private static ModelResourceLocation sacredfluidLocation = new ModelResourceLocation(MW.MODID + ":" + SacredFluidBlock.name, "fluid"); private static ModelResourceLocation shadowfluidLocation = new ModelResourceLocation(MW.MODID + ":" + ShadowFluidBlock.name, "fluid"); private static ModelResourceLocation crazyfluidLocation = new ModelResourceLocation(MW.MODID + ":" + CrazyFluidBlock.name, "fluid"); @EventHandler public void preInit(FMLPreInitializationEvent event) { FluidRegistry.registerFluid(CorruptedFluid.instance); FluidRegistry.registerFluid(SacredFluid.instance); FluidRegistry.registerFluid(ShadowFluid.instance); FluidRegistry.registerFluid(CrazyFluid.instance); GameRegistry.registerBlock(CorruptedFluidBlock.instance, CorruptedFluidBlock.name); GameRegistry.registerBlock(SacredFluidBlock.instance, SacredFluidBlock.name); GameRegistry.registerBlock(ShadowFluidBlock.instance, ShadowFluidBlock.name); GameRegistry.registerBlock(CrazyFluidBlock.instance, CrazyFluidBlock.name); Item corrupted_fluid = Item.getItemFromBlock(CorruptedFluidBlock.instance); Item sacred_fluid = Item.getItemFromBlock(SacredFluidBlock.instance); Item shadow_fluid = Item.getItemFromBlock(ShadowFluidBlock.instance); Item crazy_fluid = Item.getItemFromBlock(CrazyFluidBlock.instance); ModelLoader.setCustomMeshDefinition(corrupted_fluid, new ItemMeshDefinition() { public ModelResourceLocation getModelLocation(ItemStack stack) { return corruptedfluidLocation; } }); ModelLoader.setCustomMeshDefinition(sacred_fluid, new ItemMeshDefinition() { public ModelResourceLocation getModelLocation(ItemStack stack) { return sacredfluidLocation; } }); ModelLoader.setCustomMeshDefinition(shadow_fluid, new ItemMeshDefinition() { public ModelResourceLocation getModelLocation(ItemStack stack) { return shadowfluidLocation; } }); ModelLoader.setCustomMeshDefinition(crazy_fluid, new ItemMeshDefinition() { public ModelResourceLocation getModelLocation(ItemStack stack) { return crazyfluidLocation; } }); ModelLoader.setCustomStateMapper(CorruptedFluidBlock.instance, new StateMapperBase() { protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return corruptedfluidLocation; } }); ModelLoader.setCustomStateMapper(SacredFluidBlock.instance, new StateMapperBase() { protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return sacredfluidLocation; } }); ModelLoader.setCustomStateMapper(ShadowFluidBlock.instance, new StateMapperBase() { protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return shadowfluidLocation; } }); ModelLoader.setCustomStateMapper(CrazyFluidBlock.instance, new StateMapperBase() { protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return crazyfluidLocation; } }); } public static final class CorruptedFluid extends Fluid { public static final String name = "corrupted_water"; public static final CorruptedFluid instance = new CorruptedFluid(); private CorruptedFluid() { super(name, new ResourceLocation(MW.MODID + ":" + "blocks/" + name + "_still"), new ResourceLocation(MW.MODID + ":" + "blocks/" + name + "_flow")); } } public static final class SacredFluid extends Fluid { public static final String name = "sacred_water"; public static final SacredFluid instance = new SacredFluid(); private SacredFluid() { super(name, new ResourceLocation(MW.MODID + ":" + "blocks/" + name + "_still"), new ResourceLocation(MW.MODID + ":" + "blocks/" + name + "_flow")); } } public static final class ShadowFluid extends Fluid { public static final String name = "shadow_water"; public static final ShadowFluid instance = new ShadowFluid(); private ShadowFluid() { super(name, new ResourceLocation(MW.MODID + ":" + "blocks/" + "dark_water" + "_still"), new ResourceLocation(MW.MODID + ":" + "blocks/" + "dark_water" + "_flow")); } } public static final class CrazyFluid extends Fluid { public static final String name = "crazy_water"; public static final CrazyFluid instance = new CrazyFluid(); private CrazyFluid() { super(name, new ResourceLocation(MW.MODID + ":" + "blocks/" + name + "_still"), new ResourceLocation(MW.MODID + ":" + "blocks/" + name + "_flow")); } } public static final class CorruptedFluidBlock extends BlockFluidClassic { public static final CorruptedFluidBlock instance = new CorruptedFluidBlock(); public static final String name = "corrupted_water"; private CorruptedFluidBlock() { super(CorruptedFluid.instance, Material.water); setUnlocalizedName(name); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } } public static final class SacredFluidBlock extends BlockFluidClassic { public static final SacredFluidBlock instance = new SacredFluidBlock(); public static final String name = "sacred_water"; private SacredFluidBlock() { super(SacredFluid.instance, Material.water); setUnlocalizedName(name); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } } public static final class ShadowFluidBlock extends BlockFluidClassic { public static final ShadowFluidBlock instance = new ShadowFluidBlock(); public static final String name = "shadow_water"; private ShadowFluidBlock() { super(ShadowFluid.instance, Material.water); setUnlocalizedName(name); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } } public static final class CrazyFluidBlock extends BlockFluidClassic { public static final CrazyFluidBlock instance = new CrazyFluidBlock(); public static final String name = "crazy_water"; private CrazyFluidBlock() { super(CrazyFluid.instance, Material.water); setUnlocalizedName(name); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } } } It is a bug due to the fact that Forge for 1.9 is still a beta or am i missing something? (This is almost the same code from 1.8, where fluids works as intended)
  23. Don't know the answer but looking at how the new zombie villagers are rendered i think is not possibile. I mean, if it is why mojang didn't use a base texture and then overlay the cloth?
  24. I think is called each time a player equip a piece of armor, so if he has already the 3 pieces equipping the last will call this function and do some stuff (in this case allow flying) I used that function in 1.7.10 to do the same thing and it works
  25. You can try using the onArmorTick function in your armor class, so check each piece of armor, if they compose a full set of your armor then allow player to fly, else deny
×
×
  • Create New...

Important Information

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