Skip to content

Commit 63460b3

Browse files
committed
Try to fix Drill Fuel edge-case
Signed-off-by: Noaaan <[email protected]>
1 parent 3c95aa7 commit 63460b3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

PATCHNOTES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# 0.17.2
2-
- Added a Platinum Watch. A sturdier clock that even works in The Nether
2+
- Added a Platinum Watch. A sturdier clock that even works in The Nether (1.19.3 only)
33
- Improved Carmot Staff and Mythril Drill tooltips
44
- Banglum Ore is now affected by the +1 Fortune ability from the Mythril Drill
55
- Reduced the effect of the Banglum Defuser (102% -> 92%)
6+
- Attempted to fix an edge case where the Drill would not consume fuel
67

78
# 0.17.1
89
- Fixed an issue where world-gen would not work correctly (#146, only relevant to 1.19.3)

src/main/java/nourl/mythicmetals/item/tools/MythrilDrill.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ public class MythrilDrill extends PickaxeItem {
6262
* A fully fueled drill should last 30 minutes
6363
*/
6464
public static final int MAX_FUEL = 1000;
65+
/**
66+
* Each piece of Morkite will fuel the drill by this constant worth of units
67+
*/
6568
public static final int FUEL_CONSTANT = 10;
6669

6770
public MythrilDrill(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
@@ -135,7 +138,7 @@ public boolean onClicked(ItemStack drill, ItemStack cursorStack, Slot slot, Clic
135138
// If right-clicking with Morkite on Drill, try to fuel it
136139
if (cursorStack.getItem().equals(MythicItems.Mats.MORKITE)) {
137140

138-
// Dont bother interacting if the Drills fuel is full
141+
// Don't bother interacting if the Drills fuel is full
139142
if (drill.get(FUEL).equals(MAX_FUEL)) return false;
140143

141144
// Greedily take all the morkite if we can, otherwise calculate how much to take
@@ -217,7 +220,8 @@ public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> too
217220

218221
@Override
219222
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
220-
if (!world.isClient && hasFuel(stack) && isActive(stack) && MathHelper.floor(world.getTime()) % (4 * FUEL_CONSTANT) == 1) {
223+
if (!world.isClient && hasFuel(stack) && isActive(stack) && world.getTime() % (4 * FUEL_CONSTANT) == 1) {
224+
System.out.println(world.getTime());
221225
stack.put(FUEL, stack.get(FUEL) - 1);
222226
}
223227
if (!hasFuel(stack)) {

0 commit comments

Comments
 (0)