-
How to change location of Camera[1.8]
I managed to change the entity viewpoint relatively easily in 1.7.10, just change a field in Minecraft.getMinecraft(). I'll add the name of the field when I'm at home. EDIT: Minecraft.getMinecraft().renderViewEntity = (EntityLivingBase) event.target; is what I did. No reflection needed; renderViewEntity is public (this was in EntityInteractEvent handler).
-
S35PacketUpdateTileEntity only getting sent on world load?
The block renders differently dependant on whether there's something in the slot or not.
-
S35PacketUpdateTileEntity only getting sent on world load?
How else should I sync the inventory, IMessage?
-
S35PacketUpdateTileEntity only getting sent on world load?
Any expansion on that statement?
-
S35PacketUpdateTileEntity only getting sent on world load?
Line 2 removed, for some reason original "vanilla" crash doesn't come back. And no, markBlockForUpdate ISN'T resending the packet.
-
[SOLVED] Eclipse not seeing any java files in Baubles API?
I've installed the Baubles API what seems to me like correctly, with the API file linked to in Eclipse project setup and the deobf in the mods folder. Eclipse says there's no files in baubles.api unless I open it in the "navigator". I can't use the API because Eclipse just complains that IBauble doesn't exist and it won't tell me which unimplemented methods I need to add. Any help would be appreciated, also this probably isn't the right board to put this topic on . Edit: I solved this by referencing the deobf jar in eclipse instead of the api.
-
[1.7.10] Spawn Entity Infront Of Player On Item Right-Click
Be more specific. Do you want everyone reading to spawn an entity in front of the player on item right click? If you mean a projectile, say so. If you mean a <? extends EntityLivingBase> then say so.
-
S35PacketUpdateTileEntity only getting sent on world load?
That's not sending the packet, it's setting the null delegate that caused the first crash.
-
S35PacketUpdateTileEntity only getting sent on world load?
Didn't do anything=no difference between before using markBlockForUpdate() and after. @Override public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { contents[p_70299_1_] = p_70299_2_; contents[p_70299_1_].func_150996_a(contents[p_70299_1_].getItem()); markDirty(); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @Override public String getInventoryName() { return "Research Desk"; } @Override public boolean hasCustomInventoryName() { return false; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { return true; } @Override public void openInventory() {} @Override public void closeInventory() {} @Override public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { if (p_94041_2_ != null && p_94041_2_.getItem() == Item.itemRegistry.getObject("paper")) { return true; } else return false; } @Override public void readFromNBT(NBTTagCompound nbtTag) { super.readFromNBT(nbtTag); contents[0] = ItemStack.loadItemStackFromNBT(nbtTag.getCompoundTag("Item")); } @Override public void writeToNBT(NBTTagCompound nbtTag) { super.writeToNBT(nbtTag); NBTTagCompound item = new NBTTagCompound(); if (contents[0] != null) contents[0].writeToNBT(item); nbtTag.setTag("Item", item); } public ResourceLocation getBlockTexture() { if (contents[0] == null && contents[0] != new ItemStack((Item)null)) { return new ResourceLocation("soulwizardry:textures/blocks/ModelResearchDesk.png"); } else { return new ResourceLocation("soulwizardry:textures/blocks/ModelResearchDeskPaper.png"); } } @Override public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, tag); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { System.out.println("Packet!"); readFromNBT(pkt.func_148857_g()); } public ItemStack tryAddItemToSlot(int slot, ItemStack item) { // TODO: Cut down on the 'if's if (isItemValidForSlot(slot, item)) { if (contents[slot] != null) { if (contents[slot].getItem() == item.getItem() && contents[slot].getTagCompound() == item.getTagCompound()) { contents[slot].stackSize += item.stackSize; item.stackSize = 0; if (contents[slot].stackSize > contents[slot].getMaxStackSize()) { item.stackSize = contents[slot].stackSize - contents[slot].getMaxStackSize(); contents[slot].stackSize = contents[slot].getMaxStackSize(); } this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } else return null; } else { contents[slot] = item; return null; } } return item; } }
-
S35PacketUpdateTileEntity only getting sent on world load?
I found that on another post as well, still didn't do anything.
-
[SOLVED][1.7.x]Can I force block updates to be more frequent for custom block
@Override public void updateTick(World world, int x, int y, int z, Random rand) { EntityPlayer player = world.getClosestPlayer(x+0.5, y+0.5, z+0.5, -1); if (player.getDistanceSq(x, y, z)>1 && player.inventory.hasItemStack(new ItemStack(MOD.ACTIVATED_ITEM, 1, 1))) { world.setBlock(x, y, z, Blocks.air, 0, 3); } } @Override public boolean getTickRandomly() { return true; // Seems to be the only way to make it actually tick at all, tried removing, nothing happened } @Override public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) { world.scheduleBlockUpdate(x, y, z, this, 5); return meta; }
-
[SOLVED][1.7.x]Can I force block updates to be more frequent for custom block
I tried this and my block still didn't tick, so I looked at the declaration of scheduleBlockUpdate() and it did the most useful thing ever: {}. Any different methods that actually do something?
-
S35PacketUpdateTileEntity only getting sent on world load?
That statement makes no sense. You are assigning something to contents[0] in readFromNBT, so the value of contents[0] does not matter, whether it's null or not. Sorry, I got confused between the staticness of readFromNBT() (non-static) and loadItemStackFromNBT() (static). That isn't the problem though. I fixed the crash with func_150996_a() but now the S35PacketUpdateTileEntity only gets sent once when you load the world.
-
S35PacketUpdateTileEntity only getting sent on world load?
I can't do that because if I do it crashes with an NPE because contents[0] is null when I try to call loadItemStackFromNBT(). I ran func_150996_a() to set the null delegate every time setInventorySlotContents() gets called and that fixed the bug. Now S35PacketUpdateTileEntity only gets sent on world load for some reason, but I'm not sure if it did that anyway. Also markDirty() doesn't do anything.
-
S35PacketUpdateTileEntity only getting sent on world load?
That's what stopped the crash. It actually sets the delegate so there isn't an NPE when you use getItem().
IPS spam blocked by CleanTalk.