
zedblade
Members-
Posts
62 -
Joined
-
Last visited
Everything posted by zedblade
-
Hello, I ran into a strange packet issue: When I send a packet to update the server for an ItemStack.TagCompount changes, it seems can't upadate nothing, even if i use the ItemStack or TagCompound object: Packet: public class PacketPlayerStats implements IMessage { ItemStack drill; NBTTagCompound stackCompound; public PacketPlayerStats() { } public PacketPlayerStats(ItemStack item, NBTTagCompound compound) { this.drill = item; this.stackCompound = compound; } @Override public void fromBytes(ByteBuf buf) { this.drill = ByteBufUtils.readItemStack(buf); this.stackCompound = ByteBufUtils.readTag(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeItemStack(buf, this.drill); ByteBufUtils.writeTag(buf, this.stackCompound); } public static class Handler implements IMessageHandler<PacketPlayerStats, IMessage> { @Override public IMessage onMessage(PacketPlayerStats message, MessageContext ctx) { EntityPlayer player = NetUtils.getPlayerFromContext(ctx); message.drill.stackTagCompound.setInteger("scan", (int)message.value); OR message.stackCompound.setInteger("scan", (int)message.value); return null; } } } Function: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (world.isRemote) { if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { if(!itemStack.hasTagCompound()) itemStack.setTagCompound(new NBTTagCompound()); int scanMode = itemStack.stackTagCompound.getInteger("scan"); if (scanMode == 0) { scanMode = 1; } else if (scanMode == 1) { scanMode = 2; } else if (scanMode == 2) { scanMode = 3; } else if (scanMode == 3) { scanMode = 0; } itemStack.stackTagCompound.setInteger("scan", scanMode); PacketDispatcher.sendToServer(new PacketPlayerStats(itemStack, itemStack.stackTagCompound)); } } }
-
IProxy: public abstract interface IProxy { public abstract void registerEvents(); public abstract void registerRenders(); public abstract EntityPlayer getPlayerEntity(MessageContext ctx); public abstract IThreadListener getThreadFromContext(MessageContext ctx); } CommonProxy: public class CommonProxy implements IProxy { private final Minecraft mc = Minecraft.getMinecraft(); public void registerEvents() { FMLCommonHandler.instance().bus().register(new FMLEventHandler()); MinecraftForge.EVENT_BUS.register(new ForgeEventHandler()); } @Override public void registerRenders() { } @Override public EntityPlayer getPlayerEntity(MessageContext ctx) { return (ctx.side.isClient() ? mc.thePlayer : ctx.getServerHandler().playerEntity); } @Override public IThreadListener getThreadFromContext(MessageContext ctx) { return (ctx.side.isClient() ? mc : ctx.getServerHandler().playerEntity.getServerForPlayer()); } ClientProxy: public class ClientProxy extends CommonProxy { public void registerEvents() { super.registerEvents(); } public void registerRenders(){ Items.registerRenders(); Blocks.registerRenders(); } } ServerProxy: public class ServerProxy extends CommonProxy { public void registerEvents() { super.registerEvents(); } }
-
hello, Running Server MC 1.8 forge 1306, crash error: ... instead in SSP works fine. Please Help ....
-
Well, I tried this code in creative mode for watch better the creeper movements and not in "paceful" mode, obviously: @SubscribeEvent public void onBreakBlock(BreakEvent event) { if (!player.worldObj.isRemote) { fYaw = 90.0F; // or = 270.0F or = 180.0F EntityCreeper Logger = new EntityCreeper(player.worldObj); Logger.setLocationAndAngles(event.x + 0.5D, event.y, event.z + 0.5D, fYaw, 0.0F); Logger.rotationYaw = fYaw; // <===== Tried With and WithOut this line player.worldObj.spawnEntityInWorld(Logger); } } Results same problem: the Creeper spawn allways with the same Yaw direction (0.0F). Seriously, I tried all code combinations but nothing to do ... Can I see your testing code? thank you so much ...
-
maybe you haven't noticed, but it already does ... Creeper.rotationYaw = fYaw;
-
The Code into "onBreakBlock(BreakEvent event)" function (with "@SubscribeEvent" tag): fYaw = 90.0F; EntityCreeper Creeper = new EntityCreeper(player.worldObj); Creeper.setLocationAndAngles(event.x + 0.5D, event.y, event.z + 0.5D, fYaw, 0.0F); player.worldObj.spawnEntityInWorld(Creeper); Creeper.setPositionAndRotation(event.x + 0.5D, event.y, event.z + 0.5D, fYaw, 0.0F); Creeper.rotationYaw = fYaw; Creeper.setAngles(fYaw, 0.0F); //Creeper.setRotationYawHead(fYaw); <=== Works but rotate head only
-
Hello, I notice that is inpossible rotate the yaw attribute of any entities setted always to 0: I tried this code but doesn't works: EntityCreeper Creeper = new EntityCreeper(player.worldObj); Creeper.setLocationAndAngles(event.x + 0.5D, event.y, event.z + 0.5D, fYaw, 0.0F); player.worldObj.spawnEntityInWorld(Creeper ); Creeper.setPositionAndRotation(event.x + 0.5D, event.y, event.z + 0.5D, fYaw, 0.0F); Creeper.rotationYaw = fYaw; Creeper.setAngles(fYaw, 0.0F); please help ...
-
Hi, In this code I try to retrieve the current Item into to a StackItem variable but when put the code nothing works Code without error: Code with java.lang.NullPointerException: What happen? Is it needs to refresh the ItemStack, EntityPlayer or what? thx
-
Hi, Is there a function/method that toggle the held item display? Similar to the "F1" effect but only regarding the held item. thank you
-
Hello, I'm using the follow code to zoom the view when holding a bow: ReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, charge, "cameraZoom", "field_78503_V"); BUT when makes the zoom the held item (the bow) disappears ... o_O How can I display however the bow? thx
-
Hello, can someone kindly give me the IDs fx List of the playAuxSFX function? thank u soooooo much
-
Helllo, I cant reobfuscate my mod already from many months, and NOW I see the same problem when it says "I cant find md5s server": Someone suggest me to use ForgeGradle but i NEVER found the setup file for MC 1.6.4, please help me.....
-
[1.7.10] Tooltip text with "hold" shift like TiC tooltip
zedblade replied to zedblade's topic in Modder Support
Yes, i put some code on addInformation in my Item but i dont know how intercept "IF KEY PRESSED" event ...have you an example? thx -
Hello, I need to make a tooltip like TinckerConstruct tooltip style with more info by holding "sfift" or "ctrl" button. thx
-
Hello, I made a custom pickaxe with a recipe like vanilla pickaxe but with emerald as base material: My question is: how can i repair my pickaxe in anvil by adding emerald items like diamonds with diamond pickaxe? I tried put all material in anvil ma nothing appens .. thx a lot
-
Ok thx it was wrong library ....
-
I tried this: <spoiler> public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { list.add("test"); //list.setForeground©; } </spoiler> But nothing appares
-
Hello, I cant find the ItemToolTipEvent function to add some description to my item so anyone can show me an simple example to do it? PS: I tried to use addInfomation function but nothing to display on tooltip shape ... thx
-
oh thank u, but i notice that there isnt a lot of colors type "orange" etc.., how is it possible? thx
-
hi, I need to show a text message in chat with multiple format eg. color GREEN and ITALIC at same time. I tryed this but seems wont work: player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GREEN.ITALIC + "Hello World!!!")); or player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.ITALIC.GREEN + "Hello World!!!")); thx
-
Hello every1, I need to intercept the left click function of my item when hit a block type stone, but I can't seem to find an easy way to override it The two functions I found from Item were: this.onLeftClickEntity(stack, player, entity) //only occurs when you click an entity (the blocks seems not occurs) this.onEntitySwing(entityLiving, stack) //apparently seems most appropiate but i dont know how verify when hit a block thx
-
Hello, I need to get the current front of player coordinates.... I mean not the real player coordinates (eg. posX, posY, posZ) but the "cursor" coordinates ie where the player looking. basically I'm looking for the specific player attribute .... thx