-
Posts
6157 -
Joined
-
Last visited
-
Days Won
59
Everything posted by Animefan8888
-
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).
-
Client-Side Event Needs to be Ran Server-Side
Animefan8888 replied to Jimmeh's topic in Modder Support
You need to create a custom packet and send it to the server where it handles the spawning of the rock. -
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.
-
You parameters match is it not running at all? Try adding an @Override above it.
-
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)
-
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.
-
[SOLVED] Checking for Shift-Right Click onItemUse
Animefan8888 replied to Lambda's topic in Modder Support
You don't check if the player is sneaking. -
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
Post your TreeType enum. -
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
Post a new log. -
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.
-
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
Is this what your item model file looks like? Without the "// or minecraft:block/oak_log" of course. -
You need to allocate more ram to the game, but this is the wrong thread for this.
-
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
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. -
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
Can I assume you have it like so "parent": "block/oak_log" // or minecraft:block/oak_log -
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
Remove the forge marker. -
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
In your item json model it should be "parent": "block/oak_log" -
[1.10.2] Block textured, but ItemBlock is not
Animefan8888 replied to WaffleMan0310's topic in Modder Support
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. -
[1.10] CustomEntity transform automaticaly into pig? o.O
Animefan8888 replied to terraya's topic in Modder Support
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. -
You need to call your PacketHandler.init() somewhere in your main mod class.
-
Sadly if it was the world it would error earlier in the code....I'm thinking his PacketHandler.theNetwork is not initialized.
-
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.
-
What is sendUpdateWithInterval line 231?
-
[1.10.2] Stop player from using the left hand slot
Animefan8888 replied to a topic in Modder Support
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.