Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id 'eclipse'
id 'maven-publish'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.25'
id 'com.gtnewhorizons.retrofuturagradle' version '1.4.3'
id 'net.darkhax.curseforgegradle' version '1.1.17' apply false
id 'com.modrinth.minotaur' version '2.8.6' apply false
id 'com.diffplug.spotless' version '6.13.0' apply false
Expand Down Expand Up @@ -404,7 +404,8 @@ repositories {
//noinspection ForeignDelegate
maven {
name = 'Curse Maven'
url = 'https://www.cursemaven.com'
url = 'http://www.cursemaven.com'
allowInsecureProtocol = true
// url = 'https://beta.cursemaven.com'
}
}
Expand Down Expand Up @@ -434,8 +435,7 @@ repositories {
}
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public'
allowInsecureProtocol = true
url 'https://nexus.gtnewhorizons.com/repository/public/'
}
}
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
Expand Down Expand Up @@ -513,7 +513,7 @@ dependencies {

compileOnlyApi 'org.jetbrains:annotations:24.1.0'
annotationProcessor 'org.jetbrains:annotations:24.1.0'
patchedMinecraft('net.minecraft:launchwrapper:1.17.2') {
patchedMinecraft('net.minecraft:launchwrapper:1.12') {
transitive = false
}

Expand Down Expand Up @@ -1092,13 +1092,17 @@ boolean performBuildScriptUpdate() {
boolean isNewBuildScriptVersionAvailable() {
Map parameters = ["connectTimeout": 10000, "readTimeout": 10000]

String currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript)
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
String availableBuildScriptHash = getVersionHash(availableBuildScript)
try {
String currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript)
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
String availableBuildScriptHash = getVersionHash(availableBuildScript)

boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate
} catch (Exception ignored) {
return false
}
}

static String getVersionHash(String buildScriptContent) {
Expand Down
1 change: 0 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ dependencies {
implementation rfg.deobf("curse.maven:cofh-core-69162:2920433")
implementation rfg.deobf("curse.maven:botania-tweaks-295114:3092102")
compileOnly "CraftTweaker2:CraftTweaker2-API:4.1.20.684"
compileOnly rfg.deobf("curse.maven:ae2-fluid-crafting-rework-623955:5751930")
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ modId=crazyae
modGroup=dev.beecube31.crazyae2
# Version of your mod.
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
modVersion=v0.6.0.2
modVersion=v0.6.0.4
# The name of your jar when you produce builds, not including any versioning info
modArchivesBaseName=CrazyAE-1.12.2
# Will update your build.gradle automatically whenever an update is available
Expand Down
4 changes: 1 addition & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ pluginManagement {
maven {
// RetroFuturaGradle
name 'GTNH Maven'
//noinspection HttpUrlsUsage
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol = true
url 'https://nexus.gtnewhorizons.com/repository/public/'
//noinspection GroovyAssignabilityCheck
mavenContent {
includeGroup 'com.gtnewhorizons'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public List<Target<?>> getPhantomTargets(Object ingredient) {
List<IJEITargetSlot> slots = new ArrayList<>();
if (!this.inventorySlots.inventorySlots.isEmpty()) {
for (Slot slot : this.inventorySlots.inventorySlots) {
if (slot instanceof SlotFake && !itemStack.isEmpty()) {
if (slot instanceof SlotFake fakeSlot && fakeSlot.isDraggable() && !itemStack.isEmpty()) {
slots.add((IJEITargetSlot) slot);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.client.gui.sprites.StateSprite;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalBrewery;
Expand All @@ -26,11 +26,11 @@ protected void initSlots() {

for (int y = 0; y < 2; y++) {
for (int x = 0; x < 3; x++) {
this.addSlotToContainer(new SlotFake(input, x + y * 3, 62 + x * 18, 16 + y * 18, true));
this.addSlotToContainer(new BotaniaSlotFake(input, x + y * 3, 62 + x * 18, 16 + y * 18, true));
}
}

this.addSlotToContainer(new SlotFake(bottle, 0, 80, 53, true).setIIcon(StateSprite.BREW));
this.addSlotToContainer(new BotaniaSlotFake(bottle, 0, 80, 53, true).setIIcon(StateSprite.BREW));
this.addSlotToContainer(new SlotOutput(output, 0, 80, 87, null));

this.addSlotToContainer(new RestrictedSlot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.client.gui.sprites.StateSprite;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalElventrade;
Expand All @@ -26,7 +26,7 @@ protected void initSlots() {

for (int y = 0; y < 2; y++) {
for (int x = 0; x < 8; x++) {
this.addSlotToContainer(new SlotFake(input, x + y * 8, 17 + 18 * x, 14 + 18 * y, true));
this.addSlotToContainer(new BotaniaSlotFake(input, x + y * 8, 17 + 18 * x, 14 + 18 * y, true));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.beecube31.crazyae2.common.containers;

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.client.gui.sprites.StateSprite;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalManapool;
Expand All @@ -23,8 +23,8 @@ protected void initSlots() {
final IItemHandler input = this.getUpgradeable().getInventoryByName("input");
final IItemHandler output = this.getUpgradeable().getInventoryByName("output");

this.addSlotToContainer(new SlotFake(input, 0, 70, 30, true));
this.addSlotToContainer((new SlotFake(input, 1, 89, 30, true)).setIIcon(StateSprite.BOTANIA_CATALYSTS_SLOT));
this.addSlotToContainer(new BotaniaSlotFake(input, 0, 70, 30, true));
this.addSlotToContainer((new BotaniaSlotFake(input, 1, 89, 30, true)).setIIcon(StateSprite.BOTANIA_CATALYSTS_SLOT));

this.addSlotToContainer(new SlotOutput(output, 0, 80, 68, null));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.beecube31.crazyae2.common.containers;

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.client.gui.sprites.StateSprite;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalPetal;
Expand All @@ -25,7 +25,7 @@ protected void initSlots() {

for (int y = 0; y < 2; y++) {
for (int x = 0; x < 8; x++) {
this.addSlotToContainer(new SlotFake(input, x + y * 8, 17 + 18 * x, 14 + 18 * y, true));
this.addSlotToContainer(new BotaniaSlotFake(input, x + y * 8, 17 + 18 * x, 14 + 18 * y, true));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.client.gui.sprites.StateSprite;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalPuredaisy;
Expand All @@ -23,7 +23,7 @@ protected void initSlots() {
final IItemHandler input = this.getUpgradeable().getInventoryByName("input");
final IItemHandler output = this.getUpgradeable().getInventoryByName("output");

this.addSlotToContainer(new SlotFake(input, 0, 80, 30, true));
this.addSlotToContainer(new BotaniaSlotFake(input, 0, 80, 30, true));

this.addSlotToContainer(new SlotOutput(output, 0, 80, 68, null));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.beecube31.crazyae2.common.containers;

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalRunealtar;
Expand All @@ -24,7 +24,7 @@ protected void initSlots() {

for (int y = 0; y < 2; y++) {
for (int x = 0; x < 8; x++) {
this.addSlotToContainer(new SlotFake(input, x + y * 8, 17 + 18 * x, 14 + 18 * y, true));
this.addSlotToContainer(new BotaniaSlotFake(input, x + y * 8, 17 + 18 * x, 14 + 18 * y, true));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.beecube31.crazyae2.common.containers;

import appeng.api.networking.IGridNode;
import dev.beecube31.crazyae2.common.containers.base.slot.BotaniaSlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.RestrictedSlot;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotFake;
import dev.beecube31.crazyae2.common.containers.base.slot.SlotOutput;
import dev.beecube31.crazyae2.common.enums.BotaniaMechanicalDeviceType;
import dev.beecube31.crazyae2.common.tile.botania.TileMechanicalTerraplate;
Expand All @@ -21,12 +21,17 @@ protected void initSlots() {
final IItemHandler upgrades = this.getUpgradeable().getInventoryByName("upgrades");
final IItemHandler input = this.getUpgradeable().getInventoryByName("input");
final IItemHandler output = this.getUpgradeable().getInventoryByName("output");
final IItemHandler marker = this.getUpgradeable().getInventoryByName("findSlot");

this.addSlotToContainer(new SlotFake(input, 0, 61, 30, true));
this.addSlotToContainer(new SlotFake(input, 1, 80, 30, true));
this.addSlotToContainer(new SlotFake(input, 2, 99, 30, true));
for (int y = 0; y < 2; y++) {
for (int x = 0; x < 7; x++) {
this.addSlotToContainer(new BotaniaSlotFake(input, x + y * 7, 26 + 18 * x, 16 + 18 * y, true));
}
}

this.addSlotToContainer(new BotaniaSlotFake(marker, 0, 80, 52, true).setNotDraggable());

this.addSlotToContainer(new SlotOutput(output, 0, 80, 68, null));
this.addSlotToContainer(new SlotOutput(output, 0, 80, 86, null));

this.addSlotToContainer(new RestrictedSlot(
this.type == BotaniaMechanicalDeviceType.ELVENTRADE ? RestrictedSlot.PlaceableItemType.ELVENTRADE_BLANK_PATTERN
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.beecube31.crazyae2.common.containers.base.slot;

import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;

public class BotaniaSlotFake extends SlotFake {

public BotaniaSlotFake(final IItemHandler inv, final int idx, final int x, final int y) {
super(inv, idx, x, y);
}

public BotaniaSlotFake(final IItemHandler inv, final int idx, final int x, final int y, final boolean oneStack) {
super(inv, idx, x, y, oneStack);
}

@Override
public void putStack(ItemStack is) {
if (!is.isEmpty()) {
is = is.copy();
is.setCount(1);
}

super.putStack(is);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ public enum Features implements IFeature {
QUANTUM_CHANNELS_MULTIPLIER(
new FeatureSet().add("mixin:qcm")
),
PATTERNS_INTERFACE(
new FeatureSet().add("mixin:patterns.interface")
),
PATTERNS_INTERFACE,

DENSE_CPU_COPROCESSORS(
new FeatureSet().add("mixin:dense.coprocessor")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,28 @@ public AccessRestriction getPowerFlow(final ItemStack is) {
}

private double getInternal(final ItemStack is) {
final NBTTagCompound nbt = Platform.openNbtData(is);
return nbt.getDouble("internalCurrentPower");
if (!is.hasTagCompound()) {
return 0.0;
}
final NBTTagCompound nbt = is.getTagCompound();
return nbt != null ? nbt.getDouble("internalCurrentPower") : 0.0;
}

private void setInternal(final ItemStack is, final double amt) {
final NBTTagCompound nbt = Platform.openNbtData(is);
nbt.setDouble("internalCurrentPower", amt);
if (amt > 0.0001) {
final NBTTagCompound nbt = Platform.openNbtData(is);
nbt.setDouble("internalCurrentPower", amt);
} else {
if (is.hasTagCompound()) {
final NBTTagCompound nbt = is.getTagCompound();
if (nbt != null) {
nbt.removeTag("internalCurrentPower");
nbt.removeTag("internalMaxPower");
if (nbt.isEmpty()) {
is.setTagCompound(null);
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
Expand Down Expand Up @@ -88,14 +89,21 @@ public boolean isStorageCell(@NotNull ItemStack i) {
public abstract IItemHandler getConfigInventory(ItemStack is);

public FuzzyMode getFuzzyMode(ItemStack is) {
if (!is.hasTagCompound()) {
return FuzzyMode.IGNORE_ALL;
}
try {
return FuzzyMode.valueOf(Platform.openNbtData(is).getString("FuzzyMode"));
final NBTTagCompound nbt = is.getTagCompound();
return nbt != null ? FuzzyMode.valueOf(nbt.getString("FuzzyMode")) : FuzzyMode.IGNORE_ALL;
} catch (Throwable var4) {
return FuzzyMode.IGNORE_ALL;
}
}

public void setFuzzyMode(ItemStack is, FuzzyMode fzMode) {
if (fzMode == FuzzyMode.IGNORE_ALL && !is.hasTagCompound()) {
return;
}
Platform.openNbtData(is).setString("FuzzyMode", fzMode.name());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ public IItemHandler getConfigInventory(final ItemStack is) {

@Override
public FuzzyMode getFuzzyMode(final ItemStack is) {
final String fz = Platform.openNbtData(is).getString("FuzzyMode");
if (!is.hasTagCompound()) {
return FuzzyMode.IGNORE_ALL;
}
final NBTTagCompound nbt = is.getTagCompound();
final String fz = nbt != null ? nbt.getString("FuzzyMode") : "";
try {
return FuzzyMode.valueOf(fz);
} catch (final Throwable t) {
Expand All @@ -178,6 +182,9 @@ public FuzzyMode getFuzzyMode(final ItemStack is) {

@Override
public void setFuzzyMode(final ItemStack is, final FuzzyMode fzMode) {
if (fzMode == FuzzyMode.IGNORE_ALL && !is.hasTagCompound()) {
return;
}
Platform.openNbtData(is).setString("FuzzyMode", fzMode.name());
}

Expand Down
Loading