Everything posted by Kwibble
-
Records???
Well, to my knowledge, with resource locations, "modid:name.ogg" would be in the path assets/modid/name.ogg Like I said, that is too my knowledge. (i don't think you are wanting a resourcelocation, but then again, I could be wrong * points at signature * )
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
That we did. I apologize for not explaining it well enough in the first place, I had been talking to Malkuthe about it for a while and I was used to him already knowing some things
-
[1.7.2] Transparent Pixels Drawn As Black
I would have guessed that GL11.glEnable(GL11.GL_BLEND); wasn't on... But I am probably wrong.
-
TileEntity Datawatchers
I would assume that the furnace would be a good place to look for it. Oops.. Scratch that. The furnace doesn't use it.
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
And now I fixed the packet as well. THANK YOU SO MUCH!!!!
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
Thanks TGG! Your proxy method worked - only problems seems to be that now my packet in my item isn't being sent to the server... Well. That is another problem, but not the first! Thank you very much sir! Kudos and giant chocolate covered coconuts for you!
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
No that is absolutely NOT what I need. Take a look at what the server does if I use that: ---- Minecraft Crash Report ---- // Don't do that. Time: 6/22/14 1:12 PM Description: Exception in server tick loop cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at cpw.mods.fml.common.LoadController.transition(LoadController.java:162) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:514) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:313) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:117) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:442) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/entity/EntityClientPlayerMP at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2446) at java.lang.Class.getConstructor0(Class.java:2756) at java.lang.Class.newInstance0(Class.java:328) at java.lang.Class.newInstance(Class.java:310) at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.<init>(SimpleChannelHandlerWrapper.java:22) at cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper.getHandlerWrapper(SimpleNetworkWrapper.java:129) at cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper.addClientHandlerAfter(SimpleNetworkWrapper.java:123) at cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:111) at com.kwibble.dendri.network.DendriNetwork.registerNetwork(DendriNetwork.java:23) at com.kwibble.dendri.ModuleDendri.on(ModuleDendri.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:512) ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.entity.EntityClientPlayerMP at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 43 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/EntityClientPlayerMP for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:276) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:174) ... 45 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Mac OS X (x86_64) version 10.8.5 Java Version: 1.6.0_65, Apple Inc. Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc. Memory: 992198536 bytes (946 MB) / 1065025536 bytes (1015 MB) up to 1065025536 bytes (1015 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.03 FML v7.2.211.1121 Minecraft Forge 10.12.2.1121 4 mods loaded, 4 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{7.2.211.1121} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized Forge{10.12.2.1121} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1121.jar) Unloaded->Constructed->Pre-initialized dendri{1.7.2_0.0.1} [Dendri] (ModuleDendri) Unloaded->Constructed->Errored Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt)
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
I'm sorry, but you are missing the problem. Entirely. I shall now point you to this bit of the code: public static class Handler implements IMessageHandler<MessageClientPlayerInfo, IMessage> { @Override public IMessage onMessage(MessageClientPlayerInfo message, MessageContext ctx) { System.out.println("Client test receive: " + message.shouldDisplayOverlay); System.out.println("Client test receive: " + message.isOverlayMinimized); System.out.println("Client test receive: " + message.currentDendrikBelt); try { EntityPlayer player = Minecraft.getMinecraft().thePlayer; PlayerInformation playerinfo = PlayerInformation.forPlayer(player); playerinfo.setShouldDisplayOverlay(message.shouldDisplayOverlay); playerinfo.setIsOverlayMinimized(message.isOverlayMinimized); playerinfo.setCurrentDendrikBelt(message.currentDendrikBelt); } catch (NullPointerException e) { e.printStackTrace(); } return null; } } Specifically were it says Minecraft.getMinecraft().thePlayer; Now, this works perfectly fine when running the mod as the CombinedClient only. Whereas the server crashes. And the server crashes because the server does not contain the classes for anything client only. E.g. the Minecraft class. Also GUIs and any renderer. They are client side classes and so the server doesn't have them. So how do I get the player I am sending the packet to I guess you could say instead of using Minecraft.getMinecraft().thePlayer; I need a player instance that works both sides.
-
[1.7.2] GUI? Can't more than 256*256?
Well its actually quite 'easy'. Tessellator!!! I have made a drawing helper class I can post if you want it. All you have to do is bind the texture you want and figure out where you want to draw it! Just say the word if you want the helper class. Otherwise, ask for hints on how to do it (aside from tessellator. I already gave that hint)
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
* facepalms * I didn't explain very well, and I don't think you quite get it due to that. Sorry. Basically, the server sends a packet to the client when the client logs in. This packet contains all the values from a IExtendedEntityProperties to the client (also known as sending IExtendedEntityProperties to the client). And to retrieve the clients current version of those properties, I need an instance of the player. The real problem lies in this: The server knows nothing about the client's classes E.g. Minecraft. The client also doesn't know anything about the Server's classes. Which then leads to the question: WHERE THE HELL IS THE SHARED PLAYER?!?!?! That, or how do you get the client's player when on the server, without using server classes. If that is still confusing, have my packet code. That might help you. package com.kwibble.dendri.network.message; import com.kwibble.dendri.entity.player.PlayerInformation; import com.kwibble.dendri.item.ItemDendrikBelt; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; /** * Created by Kwibble on 19/06/14. */ public class MessageClientPlayerInfo implements IMessage { private String playerName; private boolean isOverlayMinimized, shouldDisplayOverlay; private Item currentDendrikBelt; public MessageClientPlayerInfo(){} public MessageClientPlayerInfo(PlayerInformation playerinfo, String playerName) { this.playerName = playerName; this.shouldDisplayOverlay = playerinfo.getShouldDisplayOverlay(); this.isOverlayMinimized = playerinfo.getIsOverlayMinimized(); this.currentDendrikBelt = playerinfo.getCurrentDendrikBelt(); } @Override public void fromBytes(ByteBuf buf) { this.playerName = ByteBufUtils.readUTF8String(buf); this.shouldDisplayOverlay = buf.readBoolean(); this.isOverlayMinimized = buf.readBoolean(); this.currentDendrikBelt = ByteBufUtils.readItemStack(buf).getItem(); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, this.playerName); buf.writeBoolean(this.shouldDisplayOverlay); buf.writeBoolean(this.isOverlayMinimized); ByteBufUtils.writeItemStack(buf, new ItemStack(this.currentDendrikBelt, 1)); } public static class Handler implements IMessageHandler<MessageClientPlayerInfo, IMessage> { @Override public IMessage onMessage(MessageClientPlayerInfo message, MessageContext ctx) { System.out.println("Client test receive: " + message.shouldDisplayOverlay); System.out.println("Client test receive: " + message.isOverlayMinimized); System.out.println("Client test receive: " + message.currentDendrikBelt); try { EntityPlayer player = Minecraft.getMinecraft().thePlayer; PlayerInformation playerinfo = PlayerInformation.forPlayer(player); playerinfo.setShouldDisplayOverlay(message.shouldDisplayOverlay); playerinfo.setIsOverlayMinimized(message.isOverlayMinimized); playerinfo.setCurrentDendrikBelt(message.currentDendrikBelt); } catch (NullPointerException e) { e.printStackTrace(); } return null; } } }
-
[SOLVED] Syncing IExtendedProperties to client using EntityJoinWorldEvent
So I have an IMessage, MessageClientPlayerInfo, that needs to be sent to the client when the player logs in so that I can determine whether or not to display on overlay (a boolean stored in the player info). On the client, the packet sends fine and all is well. The problem is when I run the server, and then try to join. I get an error saying that the player instance I was using was wrong. That was all well and good though because I was using Minecraft.getMinecraft().thePlayer; The crash made sense. But now I am confused as how to get a hold of the player. If I pass the players username into the packet and use: MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(message.playerName); It also crashes. I assume this is because the client has no knowledge whatsoever of the server stuff. Then of course there is always: ctx.getServerHandler().playerEntity; Which results in a crash because one cannot NetHandlerPlayClient to NetHandlerPlayServer. So what am I supposed to do to send this packet? I guess there is always the fact that this is the wrong event, but if so, why? I am so confuzzled I think I broke something. Any help is appreciated, thanks.
-
[Solved][1.7.2] LivingSpawnEvent not working
For death: LivingDeathEvent For the respawn EntityJoinedWorldEvent (or something similar).
-
[1.7.2][solved]dying a block
Everyone is repeating themselves >.> And a metadata block is the best way to go... Unless of course your block has special functionality depending on the color?
-
How would I get an Item stack to remember entity data
Well... You can read the nbt by going itemstack.stackTagCompound.get***("key_to_retrieve"); The *** is the type of whatever your wanting to retrieve.
-
How would I get an Item stack to remember entity data
I would suggest looking into NBTTagCompounds. An ITEMSTACK has a variable called stackTagCompound which is defaulted to null. With this, you could store any data you want. If your entity had special data, you could retrieve it from the entity and store it in the stack compound. You are almost asking what I have been implementing in my own mod.
-
[1.7.2] Per-Player skin changing?
You know what this is called? Logging in to Minecraft On a more serious note, try reading through the code that loads the players skin. That could help you quite a bit. Just not sure if the skin is changeable via forge...
-
Regarding custom HUD elements (replacing vanilla)
Read the if statement that I gave you. How is it different to yours?
-
Regarding custom HUD elements (replacing vanilla)
Okay. First, I apologize for want to punch your face in. I get exasperated easily. Secondly. If you use this code: @SubscribeEvent public void on(RenderGameOverlayEvent.PRE event) { if (event.type.equals(RenderGameOverlayEvent.ElementType.HEALTH) { event.setCanceled(true); // Cancels the rendering of the HEALTH bar. Take a look at all the different ElementType's } } Only the health bar should be canceled, not the food bar. That is what you were asking, no?
-
Regarding custom HUD elements (replacing vanilla)
>.> I said look into the element types didn't I? Yes? Change HEALTH to FOOD and it will only cancel the food bar. Use HEALTH and it will only cancel the health bar.
-
strange crash at minecraft
Is the package supposed to be com.hogans.craft.entities.EntityMage ? or is it supposed to be com.hoganscraft.entities.EntityMage ?
-
Have a crafting table check for special items
You can make checks before the handler does its thing can't you? For example in your tile entity: if (getStackInSlot(slot) == Items.item && getStackInSlot(slot1) == Items.item1 /* etc., etc., etc. */) { // call to the the crafting handler stuff here. }
-
Regarding custom HUD elements (replacing vanilla)
You never said that. I was just pointing out what I hadn't read in your post. All crap aside, here is what you want for one of your questions: @SubscribeEvent public void on(RenderGameOverlayEvent.PRE event) { if (event.type.equals(RenderGameOverlayEvent.ElementType.HEALTH) { event.setCanceled(true); // Cancels the rendering of the HEALTH bar. Take a look at all the different ElementType's } }
-
Regarding custom HUD elements (replacing vanilla)
When you are drawing something, the point (0,0) is the top left corner. If you were having your health bar drawn in the middle, then it must have been drawing at width / 2 and height / 2
-
Packet Handling - How to send an item with IMessage classes (packets)
Oh, that's what you meant. I thought you meant store an instance of PlayerInformation INSIDE the message and retrieve it * facepalms *. Thanks
-
Packet Handling - How to send an item with IMessage classes (packets)
Can you give me an example of retrieving the PlayerInformation from the Message? I am a bit confused as to how this works..
IPS spam blocked by CleanTalk.