-
Posts
785 -
Joined
-
Last visited
Everything posted by ItsAMysteriousYT
-
Am i able to create moving lights with that?
-
Best way to store a player into IEEP?[1.8]
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
Ah - okay, thanks -
Im searching for a way to store a player in another players IEEP and the player should still be in there when the other player changes his name. What variable of EntityPlayer do i have to use for that?
-
[1.8][SOLVED] TileEntity is missing a mapping!
ItsAMysteriousYT replied to Sakuya is my waifu's topic in Modder Support
No, don't do that - render classes can only be registered on the CLIENT, whereas TileEntities themselves need to be registered on both sides (i.e. 'common' code). You are just asking to crash your mod when you play it multiplayer by writing code like that - rendering registrations should all be in the ClientProxy. EDIT: I reread your post and see that snippet IS in your ClientProxy, in which case are you also registering the TileEntities on the server? Because the server will need to know about them, too, and it won't if they only get registered in the ClientProxy. No actually they don't - thanks for that -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
Nono, its okay, just was wondering about where i had to update it Thanks! -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
For the updating procedure, do i just call onUpdate in my TileEntity then or do i have to make that out of the itemStack somehow so it does not forcecrash the game? -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
So i just have to get the value change it and saveit back all in the NBT? Okay, strange that minecraft hasn't got a better way yet. -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
Oh - true, i tried that once, where else should i store it? IEEP would make sense here i think. -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
Better? @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected); if(!stack.hasTagCompound()){ NBTTagCompound batteryTag = new NBTTagCompound(); batteryTag.setFloat("Voltage", voltage); stack.writeToNBT(batteryTag); }else { NBTTagCompound batteryTag = stack.getTagCompound(); batteryTag.setFloat("Voltage", voltage); stack.writeToNBT(batteryTag); } } -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
Okay - ill add a check then if the stack holds a tag already. -
[1.7.10] NBT on item inventory not reading/writing
ItsAMysteriousYT replied to Roboguy99's topic in Modder Support
Im sorry - struggeling with this atm too. Here is a tutorial that should help: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-forge-1-6-4-1-8-custom-inventories-in-items-and -
Creating a batteryitem with energyvalue?
ItsAMysteriousYT replied to ItsAMysteriousYT's topic in Modder Support
Okay - im doing this right now - is this right? package itsamysterious.mods.reallifemod.core.items; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemBattery extends Item{ private float voltage; public ItemBattery() { this.voltage=100; setUnlocalizedName("itemBattery"); GameRegistry.registerItem(this, getUnlocalizedName().substring(5)); } @Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected); NBTTagCompound batteryTag = new NBTTagCompound(); batteryTag.setFloat("Voltage", voltage); stack.writeToNBT(batteryTag); } public boolean updateItemStackNBT(NBTTagCompound nbt) { NBTTagCompound batteryTag = nbt.getCompoundTag("BatteryTag"); this.voltage=batteryTag.getFloat("Voltage"); return true; } } -
[1.7.10] NBT on item inventory not reading/writing
ItsAMysteriousYT replied to Roboguy99's topic in Modder Support
Oh - than this is the problem. Make the IInventory thing in your ItemClass i would say. -
[1.7.10] problem with event handling (I think)
ItsAMysteriousYT replied to kauan99's topic in Modder Support
Yea - i would do that, also - if you don't wanna pay for your server, triangle is a good service, but atm they are in beta and the free servers do not work. Link is http://www.triangle.gs -
[1.7.10] NBT on item inventory not reading/writing
ItsAMysteriousYT replied to Roboguy99's topic in Modder Support
You need to do super.readFromNBT(combound) and super.writeToNBT(combound) -
[1.8][SOLVED] TileEntity is missing a mapping!
ItsAMysteriousYT replied to Sakuya is my waifu's topic in Modder Support
You can keep it, but its not necessary, just have a method in your clientproxy in which you register all your tileentities. If you wanna make it a bit more easy and don't wanna have all that GameRegistry.registerTileEntity stuff for each of your tiles-use this generic method: private void setupTile(Class<? extends TileEntity> class1, TileEntitySpecialRenderer render) { try { ClientRegistry.bindTileEntitySpecialRenderer(class1, render.getClass().newInstance()); } catch (Exception e) { e.printStackTrace(); } GameRegistry.registerTileEntity(class1, class1.getName()); } It takes in the TileEntity and the relatet renderer -
I wanna creat a batteryitem that gets empty after a while when in use(equipped in a specific TileEntity OR Item). How can i save the current energyvalue and where do i have to update it? There is a method called onUpdate i think - anything i have to do special in there e.g only update server/clientSide any packethandling stuff or just changing the energyvalue?
-
Okay - the energysystem is working pretty well now, just two thing - first: The blocks do not immediatly update their lighting value(e.g. lanterns) Second: The rotation still does not work in onBlockPlacedBy: My code is @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(worldIn, pos, state, placer, stack); TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntity_Electric){ TileEntity_Electric tile = (TileEntity_Electric)tileentity; tile.rotation = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; System.out.println("Succesfully rotated "+tile.getClass().getName()); } } Perhaps it is necessary to say that im extending my own CustomBlock class and not the default BlockClass for the electrisity blocks?
-
How to use Reflection to change vanilla values
ItsAMysteriousYT replied to JimiIT92's topic in Modder Support
Why not? Whats so bad about it?