mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-28 16:22:18 +00:00
Fix disk recipes
Closes #652. This has been broken since the 1.13 update. Not filling myself with confidence here.
This commit is contained in:
parent
eb2d9482a2
commit
a72a5e6deb
@ -8,7 +8,6 @@ package dan200.computercraft.shared.common;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import dan200.computercraft.shared.util.Colour;
|
|
||||||
import dan200.computercraft.shared.util.ColourTracker;
|
import dan200.computercraft.shared.util.ColourTracker;
|
||||||
import dan200.computercraft.shared.util.ColourUtils;
|
import dan200.computercraft.shared.util.ColourUtils;
|
||||||
|
|
||||||
@ -71,12 +70,7 @@ public final class ColourableRecipe extends SpecialCraftingRecipe {
|
|||||||
colourable = stack;
|
colourable = stack;
|
||||||
} else {
|
} else {
|
||||||
DyeColor dye = ColourUtils.getStackColour(stack);
|
DyeColor dye = ColourUtils.getStackColour(stack);
|
||||||
if (dye == null) {
|
if( dye != null ) tracker.addColour( dye );
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Colour colour = Colour.fromInt(15 - dye.getId());
|
|
||||||
tracker.addColour(colour.getR(), colour.getG(), colour.getB());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,9 @@ public class DiskRecipe extends SpecialCraftingRecipe {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
redstoneFound = true;
|
redstoneFound = true;
|
||||||
} else if (ColourUtils.getStackColour(stack) != null) {
|
}
|
||||||
|
else if( ColourUtils.getStackColour( stack ) == null )
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,14 +76,10 @@ public class DiskRecipe extends SpecialCraftingRecipe {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.paper.test(stack) && !this.redstone.test(stack)) {
|
if( !paper.test( stack ) && !redstone.test( stack ) )
|
||||||
DyeColor dye = ColourUtils.getStackColour(stack);
|
{
|
||||||
if (dye == null) {
|
DyeColor dye = ColourUtils.getStackColour( stack );
|
||||||
continue;
|
if( dye != null ) tracker.addColour( dye );
|
||||||
}
|
|
||||||
|
|
||||||
Colour colour = Colour.VALUES[dye.getId()];
|
|
||||||
tracker.addColour(colour.getR(), colour.getG(), colour.getB());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
package dan200.computercraft.shared.util;
|
package dan200.computercraft.shared.util;
|
||||||
|
|
||||||
|
import net.minecraft.util.DyeColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reimplementation of the colour system in {@link ArmorDyeRecipe}, but bundled together as an object.
|
* A reimplementation of the colour system in {@link ArmorDyeRecipe}, but bundled together as an object.
|
||||||
*/
|
*/
|
||||||
@ -28,8 +30,15 @@ public class ColourTracker {
|
|||||||
this.count++;
|
this.count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasColour() {
|
public void addColour( DyeColor dye )
|
||||||
return this.count > 0;
|
{
|
||||||
|
Colour colour = Colour.VALUES[15 - dye.getId()];
|
||||||
|
addColour( colour.getR(), colour.getG(), colour.getB() );
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasColour()
|
||||||
|
{
|
||||||
|
return count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getColour() {
|
public int getColour() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user