Everything posted by Animefan8888
-
[1.10+] ItemHandler Output Slots
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
You need to create a custom packet and send it to the server where it handles the spawning of the rock.
-
[Solved] [1.11] Creating Quarry
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.
-
Not equal to air
You parameters match is it not running at all? Try adding an @Override above it.
-
Help with setBlockState
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)
-
Help with setBlockState
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
You don't check if the player is sneaking.
-
[SOLVED] Is there any way to tell generically if a Mob is hostile
You can loop through the tasks field and check for certain AIs such as EntityAINearestAttackableTarget, EntityAIAttackMelee, EntityAIOwnerHurtByTarget, etc.
-
[1.10.2] Block textured, but ItemBlock is not
Post your TreeType enum.
-
[1.10.2] Block textured, but ItemBlock is not
Post a new log.
-
[Solved] [1.11] Creating Quarry
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
Is this what your item model file looks like? Without the "// or minecraft:block/oak_log" of course.
-
Crazy Craft
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
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.
-
[SOLVED] Is there any way to tell generically if a Mob is hostile
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.
-
[1.10.2] Block textured, but ItemBlock is not
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
Remove the forge marker.
-
[1.10.2] Block textured, but ItemBlock is not
In your item json model it should be "parent": "block/oak_log"
-
[1.10.2] Block textured, but ItemBlock is not
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
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.
-
TE throws a Null Exception during update.
You need to call your PacketHandler.init() somewhere in your main mod class.
-
TE throws a Null Exception during update.
Sadly if it was the world it would error earlier in the code....I'm thinking his PacketHandler.theNetwork is not initialized.
-
TE throws a Null Exception during update.
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.
-
TE throws a Null Exception during update.
What is sendUpdateWithInterval line 231?
-
[1.10.2] Stop player from using the left hand slot
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.
IPS spam blocked by CleanTalk.