Jump to content

wookiederk

Members
  • Posts

    77
  • Joined

  • Last visited

Converted

  • Gender
    Male

wookiederk's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. Thats what I use under my Init. KeyBindingRegsitry.registerKeyHandler
  2. In your LanguageRegistry for pizza slices dont use an itemstack; use the item or block itself. To do that, change it to: LanguageRegistry.addName(new ItemStack(pizzaSlice, 1, i).getItem(), ItemPizzaSlice.sliceName[i]) hope this helps
  3. Another way you can do this is to make your own bedrock. In init, you can do something like Block.blocklist[block.bedrock.blockID] = yourNewBedrock.blockID And with that new bedrock you can set the hardness using YourNewBedrock.setHardness(1F) Hope this helps
  4. you can use a forge hook for the bucket handler. add this line to your init: MinecraftForge.EVENT_BUS.register(new YourBucketHandler()); Then create the class. it should look something like: public class YourBucketHandler { @ForgeSubscribe public void onBucketFill(FillBucketEvent event) { ItemStack result = fillCustomBucket(event.world, event.target); if (result == null) return; event.result = result; event.setResult(Result.ALLOW); } public ItemStack fillCustomBucket(World world, MovingObjectPosition pos) { int blockID = world.getBlockId(pos.blockX, pos.blockY, pos.blockZ); if ((blockID == You.liquidStill.blockID || blockID == You.liquidFlowing.blockID) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) { world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0); return new ItemStack(You.bucketLiquid); } else return null; } } Of course, you would need to create your own bucketLiquid itemstack. Hope this helps
  5. I dont think its needed, but il post it. The NoDefCrash on the KeyHandler is because the KeyHandler is a client side class, not server, but even with the Side Annotations it still doesnt work. 2013-07-21 09:08:52 [sEVERE] [Minecraft-Server] Encountered an unexpected exception NoClassDefFoundError java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at wookiederk.AlchemiconKeyHandler.<clinit>(AlchemiconKeyHandler.java:20) at wookiederk.Alchemicon.<init>(Alchemicon.java:137) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at java.lang.Class.newInstance0(Class.java:372) at java.lang.Class.newInstance(Class.java:325) at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:36) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:466) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) at cpw.mods.fml.common.Loader.loadMods(Loader.java:503) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:430) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.settings.KeyBinding at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 36 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/settings/KeyBinding for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:352) at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:225) ... 38 more The line on the KeyHandler is the initilization of the binding, and the load in the main class is for the KeyBindingRegistry.
  6. Hi, I have a server crash problem due to my custom Key Handler class (NoDefFound). I have tried many things that dont seem to work: I tried registering it through KeyBindingRegistry and tried TickRegistry. I also added @SideOnly(Side.Client) annotations over the keyhandler. Here is the key handler code @SideOnly(Side.CLIENT) static KeyBinding binding = new KeyBinding("Aura Screen", Keyboard.KEY_R); public AlchemiconKeyHandler() { super(new KeyBinding[] { binding }, new boolean[] { false }); } @Override public String getLabel() { return "mykeybindings"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { if (Minecraft.getMinecraft().currentScreen == null && tickEnd && Minecraft.getMinecraft().inGameHasFocus) { Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = "aura"; PacketDispatcher.sendPacketToServer(packet); } } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT); } Thanks for any help
  7. try adding something like: if (item.stackSize <= 0) { item.stacksize =item.stacksize.getItem() .getContainerItemStack(item.stacksize); }
  8. if you use getUnlocalizedName2() youl crash everytime on the server...
  9. Just make a container but dont add any slots. It kinda acts like an interface for saving stuff to the tile entity.
  10. Hi, im making a custom workbench with tile entity. However, my container code is acting strange. I managed to get the blocks saving in the matrix, but the result is invisible although obtainable, and the result yields 1 less then what should be. Please let me know what I am doing wrong and how to fix it, and thanks for any help. Edit: Fixed it myself. Make a custom slot and assign your own properties to it etc... Relevant Container Code: public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); public IInventory craftResult = new InventoryCraftResult(); private World worldObj; private int posX; private int posY; private int posZ; private TileEntityCounter counter; public ContainerCounter(InventoryPlayer par1InventoryPlayer, TileEntityCounter par2TileEntityCounter, World world, int x, int y, int z) { this.counter = par2TileEntityCounter; this.worldObj = world; this.posX = x; this.posY = y; this.posZ = z; this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); int l; int i1; for (l = 0; l < 3; ++l) { for (i1 = 0; i1 < 3; ++i1) { this.addSlotToContainer(new Slot(par2TileEntityCounter, i1 + l * 3, 30 + i1 * 18, 17 + l * 18)); } } for (l = 0; l < 3; ++l) { for (i1 = 0; i1 < 9; ++i1) { this.addSlotToContainer(new Slot(par1InventoryPlayer, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18)); } } for (l = 0; l < 9; ++l) { this.addSlotToContainer(new Slot(par1InventoryPlayer, l, 8 + l * 18, 142)); } } /** * Callback for when the crafting matrix is changed. */ public void onCraftMatrixChanged(IInventory par1IInventory) { this.craftResult.setInventorySlotContents( 0, CraftingManager.getInstance().findMatchingRecipe( this.craftMatrix, this.worldObj)); } public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < 9; i++) { this.craftMatrix.setInventorySlotContents(i, this.counter.counterItemStacks[i]); } this.onCraftMatrixChanged(this.craftMatrix); this.counter.counterItemStacks[9] = this.craftResult.getStackInSlot(0); } [/code
  11. maybe try "texturename.png" without the slash, or just make it read inside the mod folder with "/mods/modid/textures/texturename.png"
  12. Put your full code here
  13. check if its a player with instanceof if ( entity instanceof EntityPlayer) { code here}
  14. you should register all of the blocks GameRegistry.registerBlock(fencePistonOff, "Fence Piston"); GameRegistry.registerBlock(killFencePistonOff, "Killer Fence Piston"); GameRegistry.registerBlock(fencePistonOn, "Fence Piston On"); GameRegistry.registerBlock(killFencePistonOn, "Killer Fence Piston On");
×
×
  • Create New...

Important Information

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