Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. I kinda cheated when doing this, but for a furnace (something that has a specific output slot(s) I made it have an internal ID for properly inserting and if it was the normal id then I had it do nothing. @Override public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { if (slot == 2) return stack; if (slot == 3) slot--; if (canInsert(stack, slot)) { if (stacks[slot] == null) { if (!simulate) stacks[slot] = stack; return null; } if (stacks[slot].getItem() == stack.getItem() && stacks[slot].getMaxStackSize() >= stacks[slot].stackSize + stack.stackSize) { if (!simulate) stacks[slot].stackSize += stack.stackSize; return null; } else if (stacks[slot].getItem() == stack.getItem()){ int difference = stack.stackSize - (stacks[slot].getMaxStackSize() - (stacks[slot].stackSize + stack.stackSize)); if (!simulate) stacks[slot].stackSize += difference; stack.stackSize -= difference; } } return stack; } Feel free to optimize and give feedback (first time with IItemHandler).
  2. You need to create a custom packet and send it to the server where it handles the spawning of the rock.
  3. First you would have to get the chunks boundaries I would do this by grabbing the x and z position of your TE and convert it to chunk coords. Then from there you can easily get the boundries by converting it back and adding/subtracting 15. Then you need to design what it looks like with a Tessellator and VertexBuffer.
  4. You parameters match is it not running at all? Try adding an @Override above it.
  5. There are random update ticks. Look at BlockCrops. Line 28, specifically. I thought they were the same thing, like you would schedule a random tick by scheduling it using Random#nextInt(...). Bu his other problem is a wrong method signature with updateTick it is Block#updateTick(World world, BlockPos pos, IBlockState state, Random rand)
  6. I believe they need to be scheduled. world.scheduleBlockUpdate(pos, blockIn, delay, priority); I would do it in onBlockPlaced and then in the update method itself when the first one happens.
  7. You can loop through the tasks field and check for certain AIs such as EntityAINearestAttackableTarget, EntityAIAttackMelee, EntityAIOwnerHurtByTarget, etc.
  8. I would use the blockstates orientation from inside my TileEntity set a variable and either use entities/entity or a TESR if there is a better way to draw the lines someone else say something as that is all that "blockstates orientation" would be getting the blockstate from the world where the TE is and then extracting the variant for the direction. Of course this means you will have to have the Horizontal facing variants. An example of those would be in the FurnaceBlock class.
  9. Is this what your item model file looks like? Without the "// or minecraft:block/oak_log" of course.
  10. You need to allocate more ram to the game, but this is the wrong thread for this.
  11. You assigned it to a model. Model is not texture. oak_bark is a model and a texture. He probably just messed up in conveying his words.
  12. You could look for SharedMonsterAttributes.ATTACK_DAMAGE and see if they have it and if it is greater than zero. This is assuming they used the vanillas system though.
  13. Can I assume you have it like so "parent": "block/oak_log" // or minecraft:block/oak_log
  14. In your item json model it should be "parent": "block/oak_log"
  15. When you register the renderer for the ItemBlock don't call block.getRegistryName().toString() don't call the toString part. If it doesn't work post the log.
  16. as written above, its not the register. well the error are my attribute tasks: this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAITempt(this, 1.0D, Items.APPLE, false)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); one of them makes my entity to an pig X) Then remove the ones you added to make sure. If so remove them one by one, if that doesn't work try removing multiple to see which ones are causing it then come back and tell us which ones are causing the problem.
  17. You need to call your PacketHandler.init() somewhere in your main mod class.
  18. Sadly if it was the world it would error earlier in the code....I'm thinking his PacketHandler.theNetwork is not initialized.
  19. Is this your updateEntity method? if((this.storage.getEnergyStored() != this.lastEnergy || this.currentBurnTime != this.lastCurrentBurnTime || this.lastBurnTime != this.maxBurnTime) && this.sendUpdateWithInterval()){ If so post your sendUpdate line 106.
  20. Cleavers don't have a right click function though... which effectively makes it so you can't use things in the left hand slot. You could use a shift right click function for that or have it spawn in a spare item and then do things at the item. I don't think you understand the problem he wants it to function on right click, but only when it is in the specified slot IE guns in right hand and shields in left hand. This could be accomplished via the ItemRightClickEvent.
×
×
  • Create New...

Important Information

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