Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. Note that redstone do not power instantaneously. If you want both blocks to be powered at the same time, you have to take redstone delay into account.
  2. Well, as a first, you need to get the boolean. Then, only if it is set to true, should you initialize, register the item and its recipe. If you gui needs your item (i don't know why it would, but...) you should disable the gui with it. Only open the gui if boolean is set to true. All the same for any other dependency your item may have.
  3. And you can simplify it again in: public class SlotRestricted extends Slot { public static final int allowedID = yourItem.itemID; public SlotRestricted(IInventory par2IInventory, int par3, int par4, int par5) { super(par2IInventory, par3, par4, par5); } /** * Check if the stack is a valid item for this slot. */ public boolean isItemValid(ItemStack par1ItemStack) { return par1ItemStack.itemID == allowedID; } }
  4. For your first question, what would absorption be ? Is it more defense ? Second, In GuiBoneBench: public GuiBoneBench(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5)); } In GuiHandler: switch(id) { case 1: return id == 1 && world.getBlockId(x, y, z) == Mainclass.BoneBench.blockID ? new ContainerBoneBench(player.inventory, world, x, y, z) : null; } Looks strange to have two containers for the same Gui. Also, SlotBoneBench and BoneBenchRecipeSorter look like identical copies of vanilla classes. Can't you use the original ones ?
  5. No, make the change on server side means having a server side check beforehand, typically: if(!world.isRemote) { //do things } else { //do nothing }
  6. Override tryPlaceContainedLiquid(World par1World, int par2, int par3, int par4) of ItemBucket ?
  7. Should be better this way: @Mod(modid = mod_id, name = "The Nether Overhaul", version="ALPHA 1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class mod_Nether { public static final String mod_id = "teamoverhaul_netheroverhaul"; @Instance(mod_id) public static mod_Nether instance;
  8. mServer.worldServerForDimension(1) To me, this is the End dimension id. Don't know why you are using it.
  9. #3: Make sure you variable isn't static, that you change the value on server side, and save the value within NBT.
  10. You never showed that ExoServerTickHandler class. I assumed it was working. Anyway, this is another issue, which is probably easy to fix for you.
  11. var6.mcServer.getConfigurationManager().transferPlayerToDimension(var6, 0, new TeleporterSoulForest(mServer.worldServerForDimension(1))); Why are you giving this server dimension id to you teleporter ?
  12. public class ExoArmorPowerup { public static ExoServerTickHandler event; public static void sendPacket(EntityPlayer player) { ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream( byteOutputStream); try { dataOutputStream.writeInt(player.entityId);//this info is unused when handling the packet ?? } catch (Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload( ExoServerPacketHandler.ARMORPOWERUP, byteOutputStream.toByteArray()); FMLClientHandler.instance().sendPacket(packet); } public static void handlePacket(Packet250CustomPayload packet, EntityPlayer player) { // TODO Auto-generated method stub if (event.powerupIsAvailable == true) { player.worldObj.createExplosion(null, player.posX + 5, player.posY, player.posZ, 5.0F, false); player.worldObj.createExplosion(null, player.posX - 5, player.posY, player.posZ, 5.0F, false); player.worldObj.createExplosion(null, player.posX, player.posY, player.posZ + 5, 5.0F, false); player.worldObj.createExplosion(null, player.posX, player.posY, player.posZ - 5, 5.0F, false); event.powerupIsAvailable = false; } } } public class ExoServerKeyHandler extends KeyHandler { public static KeyBinding armorPowerup = new KeyBinding("Armor's Powerup", Keyboard.KEY_F); public static KeyBinding[] arrayOfKeys = new KeyBinding[] { armorPowerup }; public static boolean[] areRepeating = new boolean[] { false }; public ExoServerKeyHandler() { super(arrayOfKeys, areRepeating); } @Override public String getLabel() { return "ExotiumWorld's ServerKeyHandler"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { if(kb.keyCode == armorPowerup.keyCode) { if(tickEnd) { System.out.println("Key up"); ExoArmorPowerup.sendPacket(Minecraft.getMinecraft().thePlayer); } } } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { } // FireModeHandler.switchFireMode(); @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT); } }
  13. GotoLink replied to ss7's topic in Modder Support
    It then sounds logical that the power increases each second. You should replace the power value if it is any different.
  14. ServerKeyHandler doesn't really make sense as a name. Anyway, most errors are here: public class ExoArmorPowerup { public static ExoServerTickHandler event; public static EntityPlayer player; public static World world;// i don't see the initialization of this field, but it is useless anyway public static void sendPacket() { EntityPlayer player = Minecraft.getMinecraft().thePlayer;//This is client side only method, meaning player field is now client side only //prefer using this method in your keyhandler, and passing the argument in the method ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream( byteOutputStream); try { dataOutputStream.writeInt(player.entityId);//this info is unused when handling the packet ?? } catch (Exception e) { e.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload( ExoServerPacketHandler.ARMORPOWERUP, byteOutputStream.toByteArray()); FMLClientHandler.instance().sendPacket(packet); } public static void handlePacket(Packet250CustomPayload packet, EntityPlayer player2) { // TODO Auto-generated method stub if (event.powerupIsAvailable == true) {//you are using client-only player field while being on server side -> crash //instead use the player argument from the method //prefer using player.worldObj instead of your world field world.createExplosion(null, player.posX + 5, player.posY, player.posZ, 5.0F, false); world.createExplosion(null, player.posX - 5, player.posY, player.posZ, 5.0F, false); world.createExplosion(null, player.posX, player.posY, player.posZ + 5, 5.0F, false); world.createExplosion(null, player.posX, player.posY, player.posZ - 5, 5.0F, false); event.powerupIsAvailable = false; } } }
  15. What do you mean with " a Block where you can put in another Block" ? Is there an inventory ?
  16. The error is making your item before the PreInit event. I edited the tutorial to fix this.
  17. Your TickHandler uses World ticks, that is both client and server ones. Use the world instance instead of the ModLoader.etc shit. (with World ticks, the world instance is tickData[0]) AFAIK, you don't need your tickhandler. Simply override public void updateEntity() {} with your tick() method.
  18. Villages don't save the buildings, only the center. The system regularly check for doors to spawn villagers or golem.
  19. You use a static call with EntityPlayerBase, while isSwingInProgress is instance dependent. You can use entity.causeDamage(args); //name of the method may not be accurate
  20. I'll pretend you know a few things in Java. You can use the API directly like you would with any class, this is called a strong reference in Java. It means code will crash if an used part of the API isn't installed. ("Class not found exception"...you might have seen that already) You can have weak reference by using reflection. This a powerful tool to use, perfectly suited in your case. Well coded, new things will happen if an API is installed, but no crash on other situation. You can start learning reflection here: http://docs.oracle.com/javase/tutorial/reflect/ If you are unsure about it, you can start by using strong reference, and if you find the API easy to use and worth the effort, you can convert strong references to weak with reflection
  21. You know, till we found an actual use for those "client-only commands" that can't be handled by a GUI, there is no need for them. The fact that you like chat command more than GUI is not really a valid argument by the way.
  22. Well, you don't have any texture bound, and the renderBlockByRenderType(args) do not use block argument to get the texture.
  23. world.markBlockForUpdate(x,y,z); will also send description packet.
  24. You can do that using reflection. Remember to catch exceptions if API isn't installed.
  25. You can re-render the block by calling world.markBlockForUpdate(x,y,z); Get the dimension id with world.provider.dimensionId;

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.