Jump to content

Kokkie

Forge Modder
  • Posts

    796
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Kokkie

  1. Try to use a for-loop with world.getEntitiesInAABB() for every entity in there test if it is an instanceof EntityPlayer
  2. Call Block.shouldRenderSide(...) or something like that
  3. Use event.player.getBoundingBox() instead of AxisAlignedBB.getBoundingBox(...)
  4. It should, make sure you put it in the right place...
  5. The mighty Draco has spoken Plays epic music C.. can I be.. your disciple, oh mighty Draco
  6. I think the only way is to use a TESR... But idk and probably someone is going to tell me I'm wrong so...
  7. What do you mean with: Did you install it correctly using Gradle?
  8. Also, here is the crash log [22:07:02] [main/INFO] [FML/]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [22:07:02] [main/DEBUG] [FML/]: Instantiating coremod class FMLCorePlugin [22:07:02] [main/DEBUG] [FML/]: Added access transformer class net.minecraftforge.fml.common.asm.transformers.AccessTransformer to enqueued access transformers [22:07:02] [main/DEBUG] [FML/]: Enqueued coremod FMLCorePlugin [22:07:02] [main/DEBUG] [FML/]: Instantiating coremod class FMLForgePlugin [22:07:02] [main/DEBUG] [FML/]: Enqueued coremod FMLForgePlugin [22:07:02] [main/DEBUG] [FML/]: All fundamental core mods are successfully located [22:07:02] [main/DEBUG] [FML/]: Attempting to load commandline specified mods, relative to C:\Users\Someone\Desktop\Coding\DeGeweldigeMod 1.11.2\run\. [22:07:02] [main/DEBUG] [FML/]: Discovering coremods [22:07:02] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [22:07:02] [main/INFO] [GradleStart/]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [22:07:02] [main/INFO] [GradleStart/]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [22:07:02] [main/INFO] [LaunchWrapper/]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [22:07:02] [main/INFO] [LaunchWrapper/]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [22:07:02] [main/INFO] [LaunchWrapper/]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [22:07:02] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [22:07:02] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [22:07:02] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [22:07:02] [main/DEBUG] [FML/]: Injecting coremod FMLCorePlugin {net.minecraftforge.fml.relauncher.FMLCorePlugin} class transformers [22:07:02] [main/TRACE] [FML/]: Registering transformer net.minecraftforge.fml.common.asm.transformers.BlamingTransformer [22:07:02] [main/TRACE] [FML/]: Registering transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer [22:07:02] [main/TRACE] [FML/]: Registering transformer net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer [22:07:02] [main/TRACE] [FML/]: Registering transformer net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer [22:07:02] [main/DEBUG] [FML/]: Injection complete [22:07:02] [main/DEBUG] [FML/]: Running coremod plugin for FMLCorePlugin {net.minecraftforge.fml.relauncher.FMLCorePlugin} [22:07:02] [main/DEBUG] [FML/]: Running coremod plugin FMLCorePlugin [22:07:02] [main/ERROR] [FML/]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [22:07:02] [main/DEBUG] [FML/]: Loading deobfuscation resource C:\Users\Thomas\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20170101\1.11.2\srgs\srg-mcp.srg with 33532 records [22:07:04] [main/ERROR] [FML/]: FML appears to be missing any signature data. This is not a good thing [22:07:04] [main/DEBUG] [FML/]: Coremod plugin class FMLCorePlugin run successfully [22:07:04] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [22:07:04] [main/DEBUG] [FML/]: Injecting coremod FMLForgePlugin {net.minecraftforge.classloading.FMLForgePlugin} class transformers [22:07:04] [main/DEBUG] [FML/]: Injection complete [22:07:04] [main/DEBUG] [FML/]: Running coremod plugin for FMLForgePlugin {net.minecraftforge.classloading.FMLForgePlugin} [22:07:04] [main/DEBUG] [FML/]: Running coremod plugin FMLForgePlugin [22:07:04] [main/DEBUG] [FML/]: Coremod plugin class FMLForgePlugin run successfully [22:07:04] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [22:07:04] [main/DEBUG] [FML/]: Loaded 190 rules from AccessTransformer config file forge_at.cfg [22:07:04] [main/DEBUG] [FML/]: Validating minecraft [22:07:05] [main/DEBUG] [FML/]: Minecraft validated, launching... [22:07:05] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [22:07:05] [main/INFO] [LaunchWrapper/]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [22:07:05] [main/INFO] [LaunchWrapper/]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [22:07:05] [main/INFO] [LaunchWrapper/]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer} [22:07:13] [main/DEBUG] [FML/]: Creating vanilla freeze snapshot [22:07:13] [main/DEBUG] [FML/]: Vanilla freeze snapshot created
  9. But why does it work outside of Forge..?
  10. For all the code go to my github, idk why I didn't send you there immediately but..
  11. Hello, I am working on a money system but it doesn't work right, I have a block, the bank, which has a gui and all that works fine, until I try to buy a gold ingot, it keeps telling me I don't have enough money even though I surely have because I just sold a gold ingot... So obviously there is something wrong with the GUI, packet or capability... Here's my code: Gui: public class CheeseBankGui extends GuiScreen { private GuiButtonBank COIN_SELL; private GuiButtonBank GOLD_SELL; private GuiButtonBank COIN_BUY; private GuiButtonBank GOLD_BUY; @Override public void initGui() { buttonList.add(new GuiButtonExt(1, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Welcome in the " + TextFormatting.YELLOW + "Cheese Bank" + TextFormatting.RESET)); COIN_SELL = new GuiButtonBank(2, this.width / 2 - 30, this.height / 2 - 30, 0); GOLD_SELL = new GuiButtonBank(3, this.width / 2 + 10, this.height / 2 - 30, 1); COIN_BUY = new GuiButtonBank(4, this.width / 2 - 30, this.height / 2 + 10, 2); GOLD_BUY = new GuiButtonBank(5, this.width / 2 + 10, this.height / 2 + 10, 3); } @Override protected void actionPerformed(GuiButton button) throws IOException { buttonList.removeAll(buttonList); switch (button.id) { case 1: buttonList.add(COIN_SELL); buttonList.add(GOLD_SELL); buttonList.add(COIN_BUY); buttonList.add(GOLD_BUY); break; case 2: boolean containsCheese = false; for (int i = 0; i < this.mc.player.inventory.getSizeInventory(); i++) { Item item = this.mc.player.inventory.getStackInSlot(i).getItem(); if (item == CheeseItems.CHEESE_MONEY) { containsCheese = true; } } if (containsCheese) { CheesePacketHandler.INSTANCE.sendToServer(new CheeseBankMessage(10)); buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Succesfully added " + 10 + " C-coins")); } else { buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Not enough cheese")); } break; case 3: boolean containsGold = false; for (int i = 0; i < this.mc.player.inventory.getSizeInventory(); i++) { Item item = this.mc.player.inventory.getStackInSlot(i).getItem(); if (item == Items.GOLD_INGOT) { containsGold = true; } } if (containsGold) { CheesePacketHandler.INSTANCE.sendToServer(new CheeseBankMessage(50)); buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Succesfully added " + 50 + " C-coins")); } else { buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Not enough gold")); } break; case 4: boolean moneyCheese = false; IMoney moneyCapCheese = this.mc.player.getCapability(MoneyProvider.MONEY_CAP, null); if (moneyCapCheese.get() >= 10) { moneyCheese = true; } else { moneyCheese = false; } if (moneyCheese) { CheesePacketHandler.INSTANCE.sendToServer(new CheeseBankMessage(-10)); buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Succesfully bought a cheese coin")); } else { buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Not enough money")); } break; case 5: boolean moneyGold = false; IMoney moneyCapGold = this.mc.player.getCapability(MoneyProvider.MONEY_CAP, null); if (moneyCapGold.get() >= 50) { moneyGold = true; } else { moneyGold = false; } if (moneyGold) { CheesePacketHandler.INSTANCE.sendToServer(new CheeseBankMessage(-50)); buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Succesfully bought gold")); } else { buttonList.add(new GuiButtonExt(6, this.width / 2 - 100, this.height / 2 - 10, 200, 20, "Not enough money")); } break; case 6: this.mc.displayGuiScreen((GuiScreen) null); break; } } @Override public boolean doesGuiPauseGame() { return false; } } Gui button: public class GuiButtonBank extends GuiButton { private final ResourceLocation BANK_BUTTON_TEXTURE = new ResourceLocation( Reference.MODID + ":textures/gui/bank_button.png"); private int textureOffsetX; public GuiButtonBank(int buttonID, int xPos, int yPos, int type) { super(buttonID, xPos, yPos, 20, 20, ""); if (type == 0 || type == 2) { this.textureOffsetX = 0; } else if (type == 1 || type == 3) { this.textureOffsetX = 20; } } public void drawButton(Minecraft mc, int mouseX, int mouseY) { if (this.visible) { mc.getTextureManager().bindTexture(BANK_BUTTON_TEXTURE); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; int i = 0; if (flag) { i += this.height; } this.drawModalRectWithCustomSizedTexture(this.xPosition, this.yPosition, textureOffsetX, i, this.width, this.height, 40, 40); } } } The packet: public class CheeseBankMessage implements IMessage { public CheeseBankMessage() { } private int value; public CheeseBankMessage(int value) { this.value = value; } @Override public void toBytes(ByteBuf buf) { buf.writeInt(value); } @Override public void fromBytes(ByteBuf buf) { value = buf.readInt(); } public int getValue() { return value; } } The packet handler: public class CheeseBankMessageHandler implements IMessageHandler<CheeseBankMessage, IMessage> { @Override public IMessage onMessage(final CheeseBankMessage message, final MessageContext ctx) { final EntityPlayerMP player = ctx.getServerHandler().playerEntity; IThreadListener mainThread = (WorldServer) player.world; mainThread.addScheduledTask(new Runnable() { @Override public void run() { IMoney money = player.getCapability(MoneyProvider.MONEY_CAP, null); if (message.getValue() == 10) { player.inventory.clearMatchingItems(CheeseItems.CHEESE_MONEY, -1, 1, null); money.add(message.getValue()); } else if (message.getValue() == 50) { player.inventory.clearMatchingItems(Items.GOLD_INGOT, -1, 1, null); money.add(message.getValue()); } else if (message.getValue() == -10) { player.world.spawnEntity(new EntityItem(player.world, player.posX, player.posY, player.posZ, new ItemStack(CheeseItems.CHEESE_MONEY, 1))); money.remove(10); } else if (message.getValue() == -50) { player.world.spawnEntity(new EntityItem(player.world, player.posX, player.posY, player.posZ, new ItemStack(Items.GOLD_INGOT, 1))); money.remove(50); } } }); return null; } } Capability interface: public interface IMoney { public void set(int set); public void add(int add); public void remove(int remove); public int get(); } Capability: public class Money implements IMoney { private int money = 20; @Override public void set(int set) { money = set; if(money < 0) money = 0; } @Override public void add(int add) { money += add; if(money < 0) money = 0; } @Override public void remove(int remove) { money -= remove; if(money < 0) money = 0; } @Override public int get() { return money; } } Capability storage: public class MoneyStorage implements IStorage<IMoney> { @Override public NBTBase writeNBT(Capability<IMoney> capability, IMoney instance, EnumFacing side) { NBTTagInt comp = new NBTTagInt(instance.get()); return comp; } @Override public void readNBT(Capability<IMoney> capability, IMoney instance, EnumFacing side, NBTBase nbt) { NBTTagInt comp = (NBTTagInt) nbt; instance.set(comp.getInt()); } } And capability provider: public class MoneyProvider implements ICapabilitySerializable<NBTBase> { @CapabilityInject(IMoney.class) public static final Capability<IMoney> MONEY_CAP = null; private IMoney instance = MONEY_CAP.getDefaultInstance(); @Override public boolean hasCapability(Capability<?> capability, EnumFacing facing) { return capability == MONEY_CAP; } @Override public <T> T getCapability(Capability<T> capability, EnumFacing facing) { return capability == MONEY_CAP ? MONEY_CAP.<T> cast(this.instance) : null; } @Override public NBTBase serializeNBT() { return MONEY_CAP.getStorage().writeNBT(MONEY_CAP, instance, null); } @Override public void deserializeNBT(NBTBase nbt) { MONEY_CAP.getStorage().readNBT(MONEY_CAP, instance, null, nbt); } }
  12. So... what does that mean?
  13. Why would you have a fake player called §lWelcome? Just wondering...
  14. when I change the port to 99999 it doesn't start either, maybe it has something to do with the firewall or something?
  15. bump
  16. Try this: public int getColor() { return 0xDD9E881E; }
  17. go to colorpicker.com, pick a color you want and copy that in there, so 0x******
  18. you put in 4 parts in the color code, try removing the first FF
  19. Oh wait, you're true that was a derp of me... In your blockstate you don't have the defaults "defaults": { "model": "forge:fluid", "transform": "forge:default-item" }
  20. Just fluid as you set it to be
  21. The registry name already includes the modid, try without "modexample:" Here, you have fluidOil, while you divine it as just fluid...
  22. Can you also provide us with a git repository (github) so when can look at all the code?
×
×
  • Create New...

Important Information

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