
Cakestory
Members-
Posts
28 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Cakestory's Achievements

Tree Puncher (2/8)
1
Reputation
-
Hello, I have a few questions regarding Blockstates in 1.10.2. Currently I am creating a mod with logic gates (and, or, xor, ...) that look similar to the vanilla repeater and comperator. My AND-gate consists of 3 torches as input and an output line. The middle torch can be disabled to only enable 2 inputs. To render those I am currently using a vanilla style blockstate.json which looks like that http://pastebin.com/543BW21c and is really bad to read and difficult to write, and requires dozens of model.json files. I am pretty sure that my code is far from being good but this is the first time I am messing with blockstates and the reason I am here today. I am looking for a way to make a more readable and easier blockstate.json and if possible reduce the amount of models to as few as needed. Reading the forge tutorials on blockstates I thought about using submodels to achieve this or find a way to change the texture of a specific part of my model (model consists of parts: PANEL, TORCH_LEFT, TORCH_MIDDLE, TORCH_RIGHT). Sadly I could not find any tutorial on how to achieve this. My questions: 1. Should I use submodels for this or is there a way to set the texture of model parts from blockstate and completly disable those parts (example plz)? 2. If using submodels, is there a way to set the exact submodels location in the block (offset)? I would be really thankful for code snippets and examples. Greetings, Cakestory
-
Hi, i am currently creating a broad axe for my mod. I am using my algorithm to get the log blocks of the tree the player tries to fell. This method stores all log coords in the axe´s nbt. Now I would like to change the time it takes to break the log that is currently being harvested depending on the size of the array in my items nbt. I already found the getDigSpeed() method can do this, but my problem is, that this method is fired/checked before my tree algorithm is called in onBlockStartBreak() . Is there a way to use this methods or other ways to change the time it takes to break the block depending on the size of the tree?
-
Hi, i am working on a quiver for my mod that automatically picks up all arrows. I am using the ItemPickupEvent to pickup all arrows that are an EntityItem but I would like to have a way to detect and alter the pickup of EntityArrows that are stuck somewhere to also add these to my quiver automatically. Does anyone know an event or another way to detect EntityArrow PickUp that I could use?
-
Thanks for the nice explanation jabelar. Haven´t found anything that informative (and easy to understand) yet. There is just one thing I need to know. I have a packet (message) on Side.Client and would need to get an instance of EntityPlayer in onMessage method. I used the version from pahimar´s EE3 and was able to use ctx.getServerHandler().playerEntity for my Side.SERVER messages. But this unfortinatly does not work for clients and ctx.getClientHandler() does not have a method to get the EntityPlayer. @Override public IMessage onMessage(SyncPlayerPropsPacket message, MessageContext ctx) { EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity(); // The class below implements IExtendeEntityProperties MinetweaksExtendedPlayer.get(player).loadNBTData(data); return null; }
-
The example code from EE3 seems pretty simple. Thanks for the link jabelar. I will try to use this as soon as I have the time. I haven´t looked into netty yet, so I needed an easy tutorial. About the memory leak: There is just something I experienced in Minecraft 1.7.2 (not sure if this is not a problem in the Forge version). I have a modpack with about 20 mods. After some time the game uses much more memory and freezes when i switch to another window. When I read about the memory leak in the tutorial Packet Handling, which I guess tons of modders are using, I was wondering if this could be the problem. Any ideas on that?
-
Hi, the current tutorial for the Netty Packet Handling on the Minecraft Forge Wiki is outdated and causes memory leak, as stated by cpw. http://www.minecraftforge.net/wiki/Netty_Packet_Handling I already used this tutorial and i would like to fix this. Is there any new tutorial on how to do it right? And do you know a good tutorial generally explaining the 1.7 Netty Packet System? If not, can someone please give (at least) an example code on how to do it, or do a tutorial on it? It also would be awesome if you could include how to send the packets. I heared something about extending SimpleChannelInboundHandler? EDIT: This is where I got a working example from. So you don´t have to read all posts in case you are just searching for the solution itself:
-
That would be really helpful. I had a more detailed look at TinkersConstruct´s TabRegistry class and that is the code they use to add their Tab buttons to the inventory screen (called when the inventory key is used): public static void addTabsToInventory (GuiContainer gui) { if (gui.getClass() == GuiInventory.class) { // Values are public at runtime. int cornerX = gui.xSize; int cornerY = gui.guiTop; gui.buttonList.clear(); updateTabValues(cornerX, cornerY, InventoryTabVanilla.class); addTabsToList(gui.buttonList); } } public static void updateTabValues (int cornerX, int cornerY, Class<?> selectedButton) { int count = 2; for (int i = 0; i < tabList.size(); i++) { AbstractTab t = tabList.get(i); if (t.shouldAddToList()) { t.id = count; t.xPosition = cornerX + (count - 2) * 28; t.yPosition = cornerY - 28; t.enabled = !t.getClass().equals(selectedButton); count++; } } } public static void addTabsToList (List buttonList) { for (AbstractTab tab : tabList) { if (tab.shouldAddToList()) { buttonList.add(tab); } } } Here is the full class: https://github.com/SlimeKnights/TinkersConstruct/blob/master/src/main/java/tconstruct/client/tabs/TabRegistry.java As the comment says the values are all public at runtime. I must admit that I am just coding Java for a year now and have no direct idea on how this is handled at runtime, but as GuiInventory.xSize GuiInventory.ySize GuiInventory.guiTop GuiInventory.guiBottom GuiInventory.buttonList are not public fields there is no direct way to use them (without working around it). I would like to suggest making these fields "public" unless you see a problem in doing this. (I don´t know if there is a reason they are not public yet?)
-
[SOLVED] [1.7.2] Auto assign dimension and provider ID
Cakestory replied to Cakestory's topic in Modder Support
Awesome. Thanks for the fast reply diesieben07. -
Hi, mods like Tinkers Construct and Galacticraft add custom Inventory Tabs (like the ones in creative) to the players survival inventory. Making all these differnt mod tabs compatible with each other takes a lot of time for the mod authors or is not even possible if the one or more of the mods is not open source. If it is open source it takes a long time to look through the other modders code. It would be awesome if Forge could provide an easy way to add Tabs to the survival inventory in order to solve this problem. I solved the problem by using Java reflection, but it would be really useful if you could make GuiScreen.buttonList a public field.
-
Hi, I have a custom dimension and provider for my mod and as this still seems to use numeric IDs, I´m wondering if this could cause incompatibility with other mods using the same dim and provider ID my mod is using? Or does Forge handle this on its own? And if so, can I fix this without forcing the user to set the ID in a config file?
-
That was a perfect idea. It indeed was destroyed by the explosion. And telling me to use the onBlockExploded method was exactly the right thing. I just leave it empty. As the super method which sets the block to air, is overriden this way, the block is not destroyed anymore. Thank you coolAlias. Solution: @Override public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { // Do not call super.onBlockExploded(...) here! }
-
[1.7.2] Draw experience from the player every few ticks
Cakestory replied to Cakestory's topic in Modder Support
I will try to figure it out, later this day, with the information you provided, but I´m having problems trying to understand how this algorith really works. Maybe I will find out when I have more time to look at it. Thanks for the hint. -
Hi, I have a block with the same resistance as bedrock that is explosion proof when placed in the world and trying to destroy it with tnt or creepers. This block is placed (with a TileEntity containing the players drops) when the player dies in PlayerDropsEvent with world.setBlock(x,y,z, block). It is working fine but when the player dies from an explosion by a creeper or tnt, the placed block seems to be destroyed by that explosion, also it is explosion resistant. Does anyone know how to fix this?