-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Make a TileEntity render with a smaller bounding box?
Draco18s replied to Busti's topic in Modder Support
Make the block's bounding box bigger. -
I love it when I can search the forums and find exactly what I need. public class TickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if(type.equals(EnumSet.of(TickType.SERVER))) { onServerTick(MinecraftServer.getServer()); } } public void onServerTick(MinecraftServer server) { System.out.println("Tick"); } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.WORLD, TickType.SERVER, TickType.PLAYER); } @Override public String getLabel() { return null; } }
-
Yes. It's called a tick handler.
-
Step 1: Knowing what you want to do. Step 2: Finding similar behavior and looking at its source. Step 3: Learning shit.
-
Just use packet 250 in the way packet 250 was meant to be used. When your packet handler receives it, extract the data (the sign text), and apply it to YOUR block. The reason packet 130 doesn't work is because it doesn't find a sign at the position your block is at, so it fails to do anything.
-
Oh deary me. It seems I forgot the exact classname and you're too inflexible to look at the list of available packet classes and find number 250. Well here you go. I looked it up. Packet250CustomPayload
-
Do not mess with the item IDs, just don't. You don't need to. You will never encounter problems unless you're doing bad practice. Whereas if you do subtract the 256 back out, you will have problems with compatibility with other mods (because they won't subtract 256 and thus their config will look like it has a different ID than your mod to the player, but! it will conflict anyway).
-
Wat.
-
Try Packet250CustomData
-
Pretty much. You can't just arbitrarily create a new class and expect it to get inserted into the class hierarchy where you want it without doing REALLY complex stuff, like reflections.
-
private static int potionID; Go learn Java. This line is your problem and it's really easy to fix and if you knew anything about any object oriented language you'd know what the problem is.
-
Post code.
-
No. Most I ever did was a TileEntity that changed texture when it dealt damage to someone, but I made it a client-sided only effect (if you saved and quit, then reloaded, the default texture was back) as it was purely cosmetic. If left alone for long enough it would revert anyway (it was blood splatter, so after 5 minutes it would change back to normal).
-
Or take so long that the player is no longer on the server at all.
-
use all lower case letters in both your code and your file and folder names.
-
Yes. As for NBTs, this is a segment of working code: try { //I'm saving data to the world's save directory, inside a custom subfolder. You can also get/save NBTs //To other locations as well. Someone I know is reading (not writing) a file out of their mod's zip File rendersFolder = new File(DimensionManager.getCurrentSaveRootDirectory(), "LinkRenders"); rendersFolder.mkdir(); try { FileInputStream fis = new FileInputStream(new File(rendersFolder, s)); DataInputStream instream = new DataInputStream(fis); nbt = CompressedStreamTools.read(instream); instream.close(); fis.close(); } catch (FileNotFoundException e) { nbt = new NBTTagCompound("tag"); } NBTTagCompound yawtag = new NBTTagCompound("tag"); yawtag.setIntArray("imagedata", allData); nbt.setIntArray("imagedata", allData); int y = (int)Math.round(yaw / 22.5); nbt.setTag("yaw"+y, yawtag); nbt.setLong("date",world.getWorldInfo().getWorldTotalTime()); CompressedStreamTools.write(nbt, new File(rendersFolder, s)); } catch (IOException e) { System.out.println("Failed to write nbt " + s); }
-
That's because you're using get, not set. Example (with integer arrays): int[] white = config.get("WorldGen","dimensionWhitelistList", new int[] {0}).getIntList(); //I sort the list here config.get("WorldGen","dimensionWhitelistList", new int[] {0}).set(whitestring); You can also save NBTs on the client side, if you'd like.
-
Beep beep boop boop. Errorͤͬͬͦͬ parsing post.ͬͦͬͬͤ̄ͤͩͦͨ̄ͦͨͣͬͩ
-
Oh I see, the if statements are commented, didn't notice that.
-
Easy. Store the skin it should have in the NBT. Ask the mob what it's skin is during rendering. It should reply based on what's stored in its NBT.
-
His code is doing that, actually.