Everything posted by hydroflame
-
Key Bindings not saving
is there a workaround or we have to wait til forge fix this ?
-
Help with fixing two errors
int randomBlockID = config.getBlock("rubyblock", 3622).getInt(); and in another function rubyblock= new TopazBlock(3622, "rubyblock") you realise your code isnt doing anything right ? basicly you could remove the first part about the config and nothign woudl change
-
Help with fixing two errors
no, you have to manually tell him which id is which randomBlockID
-
transparent block preview
yes, do you have a good understanding of java and opengl ?
-
Help with fixing two errors
jsut rename then to randomBlockID1 randomBlockID2 randomBlockID3 randomBlockID4 randomBlockID5 randomBlockID6
-
Help with fixing two errors
you cant name EVERYTHING after randomBlockID ... how would the program diffenciate them ?
-
[SOLVED]Changing NBTTagName on Keypress
yes, now you know either that your key binder isnt registered correctly OR you're not pressing the right key
-
[Resolved][1.5.2] TileEntity container not doing anything upon right click
if (!world.isRemote) { TileScientificAssembler tile = (TileScientificAssembler) world.getBlockTileEntity(x, y, z); if (tile != null){ player.openGui(DiscoveryCraft.instance, GuiIDs.ASSEMBLER1, world, x, y, z); System.out.println(tile.toString()); } } btw this says that the gui will only be opened server side
-
[SOLVED]Changing NBTTagName on Keypress
well for 1, dont put the same thing in both keyDown and keyUp because itll happen twice (unless that what you want) and 2 try this @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { System.out.println("i happened"); if(kb == Baton.mode) { System.out.println("Hi"); //PacketDispatcher.sendPacketToServer(new BatonModePacket("Hello World!").makePacket()); } } if "i happened" prints, you have pressed the correct key and registered the keyhandler correctly, if "hi" doesnt print then kb != Baton.mode
-
[SOLVED]render class not working
i dont mind you taking my time but to be honest i have no idea because i havnt worked with sounds yet but im sure the wiki will help, anyway if i try to help the first thign i will do is 1 check the wiki 2 use the search bar on top of forge forum to see if i cant find anything about it 3 use call hierarchy in eclipse to understand what the method wants
-
Side-Only classes
start by looking at the tutorials, play around with things and THEN ill help, someone spent time making a tutorial about it so dont make his effort be wasted
-
[SOLVED]render class not working
might be, you might want to make it update more often so it looks smooter
-
Side-Only classes
but if i understand correctly you want your item do shoot lightning if its in a certain mdoe and maybe other stuff in another, you should change this "mode" using the itemStack nbtTagCompound instead of tying this to a gui ...
-
Side-Only classes
if(container.mode == "lightning"){ is what is in your code in the other thread, and theres no "container" anywhere
-
[Resolved][1.5.2] TileEntity container not doing anything upon right click
if you println right at the begining of "onBlockActivate" method, does it show ?
-
Side-Only classes
no actually thats not right ... can you jsut
-
Side-Only classes
holy shit that is overcomplicate just check that you are client side ... if(world.isRemote){ player.openGui(); }
-
Side-Only classes
why do you want to use a button on server side ? technicly you could send a packet to the client saying "hey btw do thsi" check Minecraft.getMinecraft().thePlayer.currentScreen to see if this GuiScreen is of type of the gui you want to interract with and if yes cast it and call the method to simulate this button press, but thsi seems very weird to want to press a button from server side
-
Player Flight in Multiplayer.
you're lucky i write code for you, i dont do it often public class PlayerTickHandler implements ITickHandler { HashMap<String, Integer> countMap = new HashMap<String, Integer>(); HashMap<String, Integer> delayMap = new HashMap<String, Integer>(); int count = 0; int delay = 0; float landMovementFactor = 0.0F; boolean check1 = true; boolean check2= true; private void onPlayerTick(EntityPlayer player) { if(countMap.get(player.username) == null){ countMap.put(player.username, 0); } if(delayMap.get(player.username) == null){ delayMap.put(player.username, 0); } count = countMap.get(player.username); delay = delayMap.get(player.username); final AttributeModifier speed1 = new AttributeModifier(player.getPersistentID(), "Emblem Speed Boost", 0.25D, 1); final AttributeModifier speed2 = new AttributeModifier(player.getPersistentID(), "Freedom Speed Boost", 0.5D, 1); if(player.inventory.hasItem(mod_rareores.ItemEmblemFlight.itemID) && player.capabilities.isCreativeMode == false && this.count < 100 && this.delay == 0) { player.capabilities.allowFlying = true; if(player.capabilities.isFlying){ this.count++; Events.Fly = true; } if(this.count > 0 && !player.capabilities.isFlying){ count = 100; } } else { this.count = 0; this.delay++; if (this.delay >= 60) { Events.Fly = false; } if (this.delay >= 1200) { this.delay = 0; } if(!player.capabilities.isCreativeMode){ player.capabilities.allowFlying = false; player.capabilities.isFlying = false; } } countMap.put(player.username, count); delayMap.put(player.username, delay); couple of things, this is only an example it was NOT compiled and so maybe it does not work (i wrote thsi completelly in forge) 2, its missing at least 1 bracket at the botom, i didnt not add it because in your original post there was also missing one and i dont know if you have more method bellow 3 google how to use hashmaps if it doesnt work, itll tell how what they are used for.
-
[SOLVED] Changing Java Version for Install (Can I? How?)
thats very weird because scala is NOT mandatory to use forge
-
Side-Only classes
actually ... here, my packing helping class good guy hydro giving away his tools import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import net.minecraft.network.packet.Packet250CustomPayload; /** * * @author hydroflame * */ public class PacketReadStream { // not sure what this does, but it works with 8 // according to oracle javadoc on bytearrayinputstream the number is the // number of byte for the stream... //edit: according to im high as fuck this variable isnt used anywhere private static final int bytesForStream = 8; private final DataInputStream inputStream; /** * Creates a wrapper for a DataInputStream for easier reading. * * @param packet * : the packet to read from */ public PacketReadStream(Packet250CustomPayload packet) { inputStream = new DataInputStream(new ByteArrayInputStream(packet.data)); } /** * Will return "" if there is an error reading * * @return the next string stored in the packet. */ public String getText() { try { return inputStream.readUTF(); } catch (IOException e) { e.printStackTrace(); } return ""; } /** * Will return 0 if there is an error reading * * @return the next int stored in the packet */ public int readInt() { try { return inputStream.readInt(); } catch (IOException e) { e.printStackTrace(); } return 0; } /** * Will return 0 if there is an error reading * * @return the next double stored in the packet */ public double readDouble() { try { return inputStream.readDouble(); } catch (IOException e) { e.printStackTrace(); } return 0; } /** * Will return 0 if there is an error reading * * @return the next float stored in the packet */ public float readFloat() { try { return inputStream.readFloat(); } catch (IOException e) { e.printStackTrace(); } return 0; } public boolean readBoolean() { try{ return inputStream.readBoolean(); }catch(Exception e){ e.printStackTrace(); } return false; } public long readLong() { try{ return inputStream.readLong(); }catch(Exception e){ e.printStackTrace(); } return 0; } } import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import net.minecraft.network.packet.Packet250CustomPayload; public class PacketWriteStream { private static final int bytesForStream =8; private final ByteArrayOutputStream byteArrayOutputStream; private final DataOutputStream dataOutputStream; public PacketWriteStream() { byteArrayOutputStream = new ByteArrayOutputStream(bytesForStream); dataOutputStream = new DataOutputStream(byteArrayOutputStream); } /** * * @param string to write into the packet * @return the object itself */ public PacketWriteStream put(String text) { try { dataOutputStream.writeUTF(text); } catch (IOException e) { } return this; } /** * * @param float to write into the packet * @return the object itself */ public PacketWriteStream put(float x) { try { dataOutputStream.writeFloat(x); } catch (IOException e) { } return this; } /** * * @param double to write into the packet * @return the object itself */ public PacketWriteStream put(double x) { try { dataOutputStream.writeDouble(x); } catch (IOException e) { } return this; } /** * * @param int to write into the packet * @return the object itself */ public PacketWriteStream put(int x) { try { dataOutputStream.writeInt(x); } catch (IOException e) { } return this; } public PacketWriteStream put(boolean b){ try{ dataOutputStream.writeBoolean(b); }catch(Exception e){ } return this; } public PacketWriteStream put(long l){ try{ dataOutputStream.writeLong(l); }catch(Exception e){ } return this; } /** * * @param channel: the name of the channel of the packet * @return a packet with the information of the PacketStream ready to be sent */ public Packet250CustomPayload makePacket(String channel) { Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = channel; packet.data = byteArrayOutputStream.toByteArray(); packet.length = byteArrayOutputStream.size(); try { dataOutputStream.close(); byteArrayOutputStream.close(); } catch (IOException e) { } return packet; } } baiscly when you want to send a packet PacketWriteStream stream = new PacketWriteStream(); stream.put(any primitive type) PacketDispatcher.send*to whoever you want*(stream.makePacket("channel"); to read PacketReadStream stream = new PacketReadStream(Packet); int i = stream.readInt(); double b = stream.readDouble(); etc
-
[SOLVED] Changing Java Version for Install (Can I? How?)
alternatively (if you dont need scalac) you can remove scalac from your PATH and itll stop trying to compile scalac files thus solving your problem
-
Side-Only classes
ahhh, ok, basicly you need to make a PacketHandler server side (register it in your main mod file) mine looks like this public class ForgeRevServerPacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { //here i do the stuff i need } } btw im using a custom class for reading and writing packets but basicly its the same as what the wiki says, and reading is the inverse of writing (OutputStream become InputStream etc)
-
Tool tutorials
heu ... out of context but how do you have 3 square and are a forge modder with 29 post, no thank you and a karma of -2 ? and "still learning java" (ok maybe thats just outdated) the ratios seems messed up
-
Side-Only classes
well i dont mind helping but what do you need, if you know how to use packets then there shouldnt be any problem ???
IPS spam blocked by CleanTalk.