Everything posted by Draco18s
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
If you need your own custom slot class, extend SlotItemHandler. It already extends Slot for you and does 99% of what you need to interact with the ItemHandlerCapability in a GUI. Anywhere you are doing world.getTileEntity() and casting to IInventory. You instead call .getCapability() on the TE (instead of casting), passing in CapabilityItemHandler.ITEM_HANDLER_CAPABILITY object as the Capability to get. That capability is then the ItemStackHandler object that is your inventory (magic!). You would also pass in a side, but for GUI stuff, null is appropriate (represents "self" or similar, if you don't actually care about sided inventories, then it doesn't matter at all).
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
Your TE's slots only. The Player's inventory is still an IInventory.
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
Instead of using Slot you use SlotItemHandler and instead of casting to IInventory you use getCapability().
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
You don't need to check for a result every tick. You only need to do it when the inventory changes.
-
[1.12] Problem with PlayerInteractEvent.RightClickBlock
Two changes would make it really performant. 1) Declare the list once and save it to a field 2) Sort the list. If the list is sorted, you can use Arrays.binarySearch to get the index of the item (or a value less than zero, which indicates its not in the array). This form of searching the array is extra fast because it can take any sorted array and treat it as a binary tree, making fewer total operations. That said, I am not sure you can do a binary search on arbitrary types, but it might work.
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
If you're not cooking it over time, then you don't need ITickable.
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
Look at the furnace.
-
[1.11.2][UNSOLVED] Custom Crafting Block Not Crafting
At the top of your class add "implements ITickable" Let your IDE underline it in red. Pick the only suggested solution that makes any sense "implement the interface") One of the methods added automatically will be one called Update
-
Help with multi-textured blocks
This is because you're extending ItemBlock and not overriding getMetadata(), which is set to return 0 by default
-
[1.12.2] getEntitiesWithinAABBExcludingEntity() no longer detects EntityItem? Alternative?
Thanks for that. Checking my code I had 1 instance of "expand" that was improper.
-
[SOLVED][1.12.2] Trouble Ajusting the attack speed of an Item
You need to set a breakpoint, then run in debug mode. And that breakpoint should be inside getItemAttributeModifiers() in ItemHoe
-
[SOLVED][1.12.2] Trouble Ajusting the attack speed of an Item
You know how to use the debugger, right? It has nothing to do with the console...
-
[SOLVED][1.12.2] Trouble Ajusting the attack speed of an Item
Use the debugger, figure out why (when getItemAttributeModifiers() is called) that the speed value you want isn't being used.
-
[SOLVED][1.12.2] Trouble Ajusting the attack speed of an Item
The attack damage field isn't used by hoes: public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) { Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 0.0D, 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double)(this.speed - 4.0F), 0)); } return multimap; }
-
Handling HTTP requests on minecraft port
It does. 1.7.10 is no longer supported here. Also there's probably a better way you can do what you want to do.
-
[1.11.2] [Solved]Custom GUI error: NullPointerException
Your inventory is size 3. this.addSlotToContainer(new Slot(tileentity, 0, 31, 24)); this.addSlotToContainer(new Slot(tileentity, 1, 66, 43)); this.addSlotToContainer(new SlotPestleOutput(player.player, tileentity, 3, 119, 30)); 0, 1, 3. Yes. That is how we count.
-
[1.11.2] [Solved]Custom GUI error: NullPointerException
-
[1.11.2] [Solved]Custom GUI error: NullPointerException
Or rather, show the TileEntity class
-
How to create custom 3D models with wavefront obj (in 1.10.2) ?
You need an item model that has a parent of the block model's json
-
How to create custom 3D models with wavefront obj (in 1.10.2) ?
How do you expect to display the item in the inventory? By registering an item model. And where do you think it goes to go find that model? At the resource location you give it. So what does it expect to find there? A JSON file.
-
How to create custom 3D models with wavefront obj (in 1.10.2) ?
FileNotFoundExceptions mean that the file....was not found
-
[1.10.2][solved] Place block in world with rotation
// Tried this but error occured public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); Of course it failed. 1) That property does not match BlockHorizontal.FACING, it's a completely different property. It just happens to have the same name and same values. Don't just create properties willy nilly, use a reference to the original. public static final PropertyDirection FACING = BlockHorizontal.FACING; magic. 2) Dispensers don't use horizontal facing, they use omnidirectional facing: that is, they can face UP and DOWN too.
-
How to create custom 3D models with wavefront obj (in 1.10.2) ?
Ok, so, one, that tutorial is out of date Two, that tutorial does some awful, awful things. Show your main class.
-
How to create custom 3D models with wavefront obj (in 1.10.2) ?
Um, this stuff:
-
Return an item from a recipy to the inventory
Then you probably need to go learn Java. This forum is not Java school, you are expected to have a certain level of understanding of OOP before posting here.
IPS spam blocked by CleanTalk.