
Poseidon5001
Members-
Posts
25 -
Joined
-
Last visited
Everything posted by Poseidon5001
-
Absolutely certain. Even found this: https://github.com/MinecraftForge/MinecraftForge/issues/2349
-
So the code has been updated a bit, apparently it was just the onEntityItemUpdate method that was causing issues. However, now (and before) I also noticed that when I use the /give command for the item, it gives me two. Is there a solution for this?
-
In my mod, I needed to create a custom EntityItem so I could detect when it would be destroyed. However, when I press q to drop the item, it simply floats in place. This is the class for the custom EntityItem: https://github.com/daPoseidonGuy/Poppets/blob/master/src/main/java/com/tenzinpelletier/poppets/entities/EntityVoodooItem.java This is the class for the Item using it: https://github.com/daPoseidonGuy/Poppets/blob/master/src/main/java/com/tenzinpelletier/poppets/items/VoodooItem.java Any help is greatly appreciated. -- daPoseidonGuy
-
If I use this for fireEvent it seems to work: @SubscribeEvent public static void fireEvent(LivingHurtEvent event) { boolean found=false; if ((event.getEntity() instanceof EntityPlayer)&&(event.getSource()==DamageSource.ON_FIRE)) { EntityPlayer player = (EntityPlayer) event.getEntity(); for(int i=0;i<player.inventory.getSizeInventory();i++) { if(player.inventory.getStackInSlot(i).getItem() == ModItems.firePoppet) { player.sendMessage(new TextComponentString("Hoorah!")); player.inventory.getStackInSlot(i).damageItem(1, player); found = true; } } } if (found==true) { EntityPlayer player = (EntityPlayer) event.getEntity(); player.sendMessage(new TextComponentString("You have been saved from fire")); player.extinguish(); event.setCanceled(true); } } However I feel there must be a more elegant solution.
-
Source Code: https://github.com/daPoseidonGuy/Poppets/tree/master/src/main Problem: In this file: https://github.com/daPoseidonGuy/Poppets/blob/master/src/main/java/com/tenzinpelletier/poppets/ForgeEventHandler.java For fireEvent, the if statement seems to fail if the fire poppet is damaged at all, and I can't seem to figure out why. Am I doing the ItemStack wrong? The function executes fine, and damages the item, but once it is damaged it no longer works. Any help is appreciated
-
Assigning different models to different blockstates of a block
Poseidon5001 replied to Poseidon5001's topic in Modder Support
I might have just fixed it by adding a model definition into the inventory field, since i dont have a model set for the ItemBlock. -
Assigning different models to different blockstates of a block
Poseidon5001 replied to Poseidon5001's topic in Modder Support
Working (without variants) Not Working (with Variants) -
Assigning different models to different blockstates of a block
Poseidon5001 replied to Poseidon5001's topic in Modder Support
Wait so no blockstate files are supposed to have capital letters? how come all my other blocks render fine, then? And isn't the blockstate file name supposed to be identical to the registry and unlocalized names? I havent changed the blockstate file name and it was working fine before i added the variants. -
Assigning different models to different blockstates of a block
Poseidon5001 replied to Poseidon5001's topic in Modder Support
So I've changed these things, but am still having trouble. I don't know if I've made other mistakes along the way or something, but it seems the entire blockstate file isn't working, since it doesn't seem to have the particle texture either. -
Assigning different models to different blockstates of a block
Poseidon5001 replied to Poseidon5001's topic in Modder Support
How is it invalid? I'd check myself but my computer broke yesterday (motherboard died). Thanks for all the comments though, I wouldn't catch a lot of those things by myself. -
Assigning different models to different blockstates of a block
Poseidon5001 replied to Poseidon5001's topic in Modder Support
PencilBlock renders as a pink and black cube, The console gives an error for literally every block state (facing=up,down, east,west etc.) However, I'm pretty sure I got everything right in the class itself, and I thought i had stuff right in the json file (now I removed some) -
Hi! I tried adding different blockstates to my block. However, despite doing my best to follow what I saw in the forge docs and whatnot, I can't seem to set textures for these models. Right now I've rolled back a bit of what I did, but here's my code: https://github.com/daPoseidonGuy/PencilMod Any help would be greatly appreciated, Thanks.
-
New update: I realized that upon logging out, my block disappears from the world. This probably has to do with the way my itemPencil places it. When giving myself the BlockItem via /give and placing it down, it recieves block updates. So this has something to do with using world.setBlockState() to place my block i guess.
-
in onNeighborChange and neighborChanged i call doUpdate(). Destroying blocks around the PencilBlock or causing a block update via other means doesn't result in the display of the message, whilst a click does, so I know doUpdate() itself works. I will try adding a breakpoint now. EDIT: Adding a breakpoint didn't seem to do anything. Also calling Minecraft is only temporary (for debugging)
-
package com.daposeidonguy.testmod.blocks; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.ParticleManager; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class PencilBlock extends BaseBlock { private static final AxisAlignedBB BOUND_BOX = new AxisAlignedBB(0, 0, 0, 16*.0625, .0625, 16*.0625); public PencilBlock() { super(Material.CARPET, "tilePencil"); this.setCreativeTab(null); this.setBlockUnbreakable(); this.setHardness(100f); this.setResistance(1f); } @Override public int quantityDropped(Random random) { return 0; } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return BOUND_BOX; } @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn) { super.addCollisionBoxToList(pos, entityBox, collidingBoxes, BOUND_BOX); } @Override public boolean isPassable(IBlockAccess worldIn, BlockPos pos) { return true; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor) { this.requiresUpdates(); } @Override public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { this.requiresUpdates(); } @Override public boolean requiresUpdates() { System.out.println("change"); Minecraft.getMinecraft().thePlayer.sendChatMessage("change"); return true; } @Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { this.requiresUpdates(); } @Override public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) { this.requiresUpdates(); } } I have been attempting to get my block to register changes to blocks nearby. Right now, as the code shows, I'm in a state of desperate debugging. Neither updateTick, neighbourchanged or onneighbourchanged are triggering requiresUpdates. However, onBlockClicked is. Any ideas? Help is greatly appreciated. Thanks in advance,
-
It works! Thank you!
-
Oh, you're right. Thank you! Hopefully that's the only thing that's wrong. EDIT: Still doesnt seem to be working. I also updated the code embedded in the main post
-
Hi everyone. I was attempting to generate trees in the overworld, but I seem to have had little success. Just wanted to see where I went wrong. Thanks package com.daposeidonguy.testmod.world; import java.util.Random; import com.daposeidonguy.testmod.ModBlocks; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Biomes; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraftforge.fml.common.IWorldGenerator; public class ModWorldGeneration implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if (world.provider.getDimension() == 0) { generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider); } } private void generateOverworld(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { generateRubberTree(world, random, chunkX, chunkZ, 20); generateOre(ModBlocks.oreLead.getDefaultState(), world, random, chunkX, chunkZ, 12, 48, 8 + random.nextInt(5), 8); } private void generateRubberTree(World world, Random random, int chunkX, int chunkZ, int chances) { int x = chunkX * 16; int z = chunkZ * 16; BlockPos biomePos = new BlockPos(chunkX, 64, chunkZ); if(world.getBiome(biomePos)== Biomes.SWAMPLAND) { for(int i=0;i<chances;i++) { BlockPos pos = new BlockPos(x + random.nextInt(16), findGround(x,z,world) + 1,z + random.nextInt(16)); WorldGenTrees generator = new WorldGenTrees(true, 4, Blocks.COAL_BLOCK.getDefaultState(), Blocks.BOOKSHELF.getDefaultState(), false); generator.generate(world, random, pos); System.out.println("Generated tree"); } } } private void generateOre(IBlockState ore, World world, Random random, int chunkX,int chunkZ, int minY, int maxY, int size, int chances) { int deltaY = maxY - minY; int x = chunkX * 16; int z = chunkZ * 16; for (int i=0; i< chances; i++) { BlockPos newPos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16)); WorldGenMinable generator = new WorldGenMinable(ore, size); generator.generate(world, random, newPos); } } private int findGround(int x,int z, World world) { int y=255; boolean foundGround = false; while(foundGround == false && y > 0) { y = y -1; IBlockState block = world.getBlockState(new BlockPos(x,y,z)); if (block == Blocks.GRASS.getDefaultState()) { foundGround = true; } else if (block == Blocks.DIRT.getDefaultState()) { foundGround = true; } else { foundGround = false; } } return y; } }
-
Hi, I was trying to update my small mod. Doesn't seem to be working. I followed some tutorials online, and I did everything they said in terms of the new way textures work as of 1.8.. eclipse shows no errors, but when I click run, Minecraft crashes at preinitialization, with this report: http://pastebin.com/qXj6wzTP Here is my source code: https://github.com/daPoseidonGuy/GlowStoneMod/tree/master/1.8/src/main Seems to be related to both of my class files that handle the item models/textures. Any help would be appreciated.
-
[1.7.10] How does the instance annotation work?
Poseidon5001 replied to Poseidon5001's topic in Modder Support
@Instance("ModID") public static ClassName instance; How does this instantiate anything though? @Instance("ModID") so here I pass along the ModID as a string to this annotation... public static ClassName instance; how does this line set the field to the instance of my mod? is the word instance here connected to the annotation @Instance? @Instance public static ClassName instance = new ClassName(); Why does this one still work? @Instance why is there no ModID being passed along here? public static ClassName instance = new ClassName(); doesn't this make more sense as it is creating a New instance? Is it this one you said won't be the one forge uses? -
@Instance("ModID") public static ClassName instance; How does this work? I understand it makes an Instance from which MinecraftForge can work from, but how does it achieve this? Also, what's the difference between the aformentioned code and this: @Instance public static ClassName instance = new ClassName(); Do they both achieve the same thing?
-
Hey, guys, me and my friend have a private server with a private modpack and we wondered if anyone would want to join our world. Mods include Ars Magica Witchery Thaumcraft (taint disabled) Blood Magic Mekanism ICBM MFFS Resonant Induction Thermal Expansion IC2 Biomes o Plenty and many more! email [email protected] or skype tenzin.pelleter if interested!