Skip to content

Commit 59d98cd

Browse files
author
Beecube31
committed
v0.5.0.1
1 parent 10ea376 commit 59d98cd

23 files changed

+333
-23
lines changed

dependencies.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ dependencies {
3737
implementation rfg.deobf("curse.maven:industrial-upgrade-372007:6237087")
3838
implementation rfg.deobf("curse.maven:cofh-core-69162:2920433")
3939
implementation rfg.deobf("curse.maven:botania-tweaks-295114:3092102")
40+
compileOnly "CraftTweaker2:CraftTweaker2-API:4.1.20.684"
4041
}

src/main/java/dev/beecube31/crazyae2/common/containers/ContainerBotaniaDevicePatternsInv.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ public ContainerBotaniaDevicePatternsInv(final InventoryPlayer ip, final TileBot
3131
for (int y = 0; y < 5; y++) {
3232
for (int x = 0; x < 9; x++) {
3333
this.addSlotToContainer(new RestrictedSlot(
34-
this.type == BotaniaMechanicalDeviceType.ELVENTRADE ? RestrictedSlot.PlaceableItemType.ELVENTRADE_BLANK_PATTERN
35-
: this.type == BotaniaMechanicalDeviceType.MANAPOOL ? RestrictedSlot.PlaceableItemType.MANAPOOL_BLANK_PATTERN
36-
: this.type == BotaniaMechanicalDeviceType.PETAL ? RestrictedSlot.PlaceableItemType.PETAL_BLANK_PATTERN
37-
: this.type == BotaniaMechanicalDeviceType.PUREDAISY ? RestrictedSlot.PlaceableItemType.PUREDAISY_BLANK_PATTERN
38-
: this.type == BotaniaMechanicalDeviceType.RUNEALTAR ? RestrictedSlot.PlaceableItemType.RUNEALTAR_BLANK_PATTERN
39-
: this.type == BotaniaMechanicalDeviceType.TERAPLATE ? RestrictedSlot.PlaceableItemType.TERAPLATE_BLANK_PATTERN
40-
: this.type == BotaniaMechanicalDeviceType.BREWERY ? RestrictedSlot.PlaceableItemType.BREWERY_BLANK_PATTERN
34+
this.type == BotaniaMechanicalDeviceType.ELVENTRADE ? RestrictedSlot.PlaceableItemType.ELVENTRADE_ENCODED_PATTERN
35+
: this.type == BotaniaMechanicalDeviceType.MANAPOOL ? RestrictedSlot.PlaceableItemType.MANAPOOL_ENCODED_PATTERN
36+
: this.type == BotaniaMechanicalDeviceType.PETAL ? RestrictedSlot.PlaceableItemType.PETAL_ENCODED_PATTERN
37+
: this.type == BotaniaMechanicalDeviceType.PUREDAISY ? RestrictedSlot.PlaceableItemType.PUREDAISY_ENCODED_PATTERN
38+
: this.type == BotaniaMechanicalDeviceType.RUNEALTAR ? RestrictedSlot.PlaceableItemType.RUNEALTAR_ENCODED_PATTERN
39+
: this.type == BotaniaMechanicalDeviceType.TERAPLATE ? RestrictedSlot.PlaceableItemType.TERAPLATE_ENCODED_PATTERN
40+
: this.type == BotaniaMechanicalDeviceType.BREWERY ? RestrictedSlot.PlaceableItemType.BREWERY_ENCODED_PATTERN
4141
: RestrictedSlot.PlaceableItemType.NONE,
4242
patternsHandler,
4343
x + y * 9,

src/main/java/dev/beecube31/crazyae2/common/containers/base/CrazyAEBaseContainer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ public ItemStack transferStackInSlot(final EntityPlayer p, final int idx) {
362362
|| it == RestrictedSlot.PlaceableItemType.PETAL_ENCODED_PATTERN
363363
|| it == RestrictedSlot.PlaceableItemType.RUNEALTAR_ENCODED_PATTERN
364364
|| it == RestrictedSlot.PlaceableItemType.PUREDAISY_ENCODED_PATTERN
365+
|| it == RestrictedSlot.PlaceableItemType.TERAPLATE_ENCODED_PATTERN
366+
|| it == RestrictedSlot.PlaceableItemType.BREWERY_ENCODED_PATTERN
365367
) return ItemStack.EMPTY;
366368
}
367369

src/main/java/dev/beecube31/crazyae2/common/containers/base/slot/RestrictedSlot.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ public boolean isItemValid(final ItemStack i) {
111111

112112
case PETAL_BLANK_PATTERN ->
113113
CrazyAE.definitions().materials().petalBlankPattern().isSameAs(i);
114+
case TERAPLATE_ENCODED_PATTERN ->
115+
CrazyAE.definitions().items().teraplateEncodedPattern().isSameAs(i);
116+
case BREWERY_ENCODED_PATTERN ->
117+
CrazyAE.definitions().items().breweryEncodedPattern().isSameAs(i);
114118
case PETAL_ENCODED_PATTERN ->
115119
CrazyAE.definitions().items().petalEncodedPattern().isSameAs(i);
116120

@@ -186,6 +190,8 @@ public enum PlaceableItemType {
186190
MANAPOOL_ENCODED_PATTERN(StateSprite.PATTERNS_SLOT_NEW),
187191
RUNEALTAR_ENCODED_PATTERN(StateSprite.PATTERNS_SLOT_NEW),
188192
PUREDAISY_ENCODED_PATTERN(StateSprite.PATTERNS_SLOT_NEW),
193+
TERAPLATE_ENCODED_PATTERN(StateSprite.PATTERNS_SLOT_NEW),
194+
BREWERY_ENCODED_PATTERN(StateSprite.PATTERNS_SLOT_NEW),
189195
PETAL_ENCODED_PATTERN(StateSprite.PATTERNS_SLOT_NEW);
190196

191197

src/main/java/dev/beecube31/crazyae2/common/interfaces/crafting/ICrazyAECraftingPatternDetails.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
import appeng.api.networking.crafting.ICraftingPatternDetails;
44

5-
public interface ICrazyAECraftingPatternDetails extends ICraftingPatternDetails { }
5+
public interface ICrazyAECraftingPatternDetails extends ICraftingPatternDetails {
6+
int getInventorySizeX();
7+
8+
int getInventorySizeY();
9+
}

src/main/java/dev/beecube31/crazyae2/common/parts/implementations/PartEnergyExportBus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private void tryExportToFEComponents(final TileEntity te) {
356356
for (Field field : te.getClass().getDeclaredFields()) {
357357
if (IEnergyStorage.class.isAssignableFrom(field.getType())) {
358358
field.setAccessible(true);
359-
IEnergyStorage candidate = (IEnergyStorage) field.get(null);
359+
IEnergyStorage candidate = (IEnergyStorage) field.get(te);
360360

361361
if (candidate.canReceive()) {
362362
int received = candidate.receiveEnergy((int) this.availableEnergy(CrazyAE.definitions().items().FEEnergyAsAeStack()), false);

src/main/java/dev/beecube31/crazyae2/common/parts/implementations/PartEnergyImportBus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ private void tryImportFromFEComponents(final TileEntity te) {
398398
for (Field field : te.getClass().getDeclaredFields()) {
399399
if (IEnergyStorage.class.isAssignableFrom(field.getType())) {
400400
field.setAccessible(true);
401-
IEnergyStorage candidate = (IEnergyStorage) field.get(null);
401+
IEnergyStorage candidate = (IEnergyStorage) field.get(te);
402402

403403
if (candidate.canExtract()) {
404404
int extracted = candidate.extractEnergy((int) this.availableEnergy(CrazyAE.definitions().items().FEEnergyAsAeStack()), false);

src/main/java/dev/beecube31/crazyae2/common/recipes/botania/RecipeRepo.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public static void addDefaultTerrasteelRecipe() {
2626
terraplateRecipes.add(new RecipeTerraplate(
2727
ImmutableList.of(manaResource(2), manaResource(0), manaResource(1)),
2828
manaResource(4),
29-
500000,
30-
0x0000FF,
31-
0x00FF00
29+
500000
3230
));
3331
}
3432

@@ -40,6 +38,14 @@ public static Optional<RecipeTerraplate> findMatchingRecipe(IItemHandler inv) {
4038
return Optional.empty();
4139
}
4240

41+
public static void add(RecipeTerraplate recipe) {
42+
terraplateRecipes.add(recipe);
43+
}
44+
45+
public static void remove(RecipeTerraplate recipe) {
46+
terraplateRecipes.remove(recipe);
47+
}
48+
4349
private static ItemStack manaResource(int meta) {
4450
return new ItemStack(ModItems.manaResource, 1, meta);
4551
}

src/main/java/dev/beecube31/crazyae2/common/recipes/botania/RecipeTerraplate.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public class RecipeTerraplate {
1717
public final ImmutableList<String> recipeOreKeys;
1818
public final ItemStack recipeOutput;
1919
public final int manaCost;
20-
public final int color1;
21-
public final int color2;
2220

2321
final int totalInputs;
2422

@@ -31,7 +29,7 @@ private void verifyInputs(ImmutableList<Object> inputs) {
3129
}
3230
}
3331

34-
public RecipeTerraplate(ImmutableList<Object> recipeInputs, ItemStack recipeOutput, int manaCost, int color1, int color2) {
32+
public RecipeTerraplate(ImmutableList<Object> recipeInputs, ItemStack recipeOutput, int manaCost) {
3533
verifyInputs(recipeInputs);
3634

3735
ImmutableList.Builder<ItemStack> stackInputBuilder = new ImmutableList.Builder<>();
@@ -48,8 +46,6 @@ public RecipeTerraplate(ImmutableList<Object> recipeInputs, ItemStack recipeOutp
4846

4947
this.recipeOutput = recipeOutput;
5048
this.manaCost = manaCost;
51-
this.color1 = color1;
52-
this.color2 = color2;
5349
}
5450

5551
public RecipeTerraplate(AgglomerationRecipe s) {
@@ -67,8 +63,6 @@ public RecipeTerraplate(AgglomerationRecipe s) {
6763

6864
this.recipeOutput = s.recipeOutput;
6965
this.manaCost = s.manaCost;
70-
this.color1 = s.color1;
71-
this.color2 = s.color2;
7266
}
7367

7468
public boolean matches(IItemHandler inv) {

src/main/java/dev/beecube31/crazyae2/common/registration/Registration.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import dev.beecube31.crazyae2.common.recipes.handlers.DisassembleRecipe;
1111
import dev.beecube31.crazyae2.common.registration.definitions.*;
1212
import dev.beecube31.crazyae2.common.registration.registry.Registry;
13+
import dev.beecube31.crazyae2.integrations.ct.CraftTweakerPlugin;
1314
import net.minecraft.block.Block;
1415
import net.minecraft.client.renderer.ItemMeshDefinition;
1516
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
@@ -74,6 +75,14 @@ public void postInit(FMLPostInitializationEvent event) {
7475
RecipeRepo.addDefaultTerrasteelRecipe();
7576
}
7677
}
78+
79+
if (Loader.isModLoaded("crafttweaker")) {
80+
this.initCraftTweakerPlugin();
81+
}
82+
}
83+
84+
public void initCraftTweakerPlugin() {
85+
CraftTweakerPlugin.postInit();
7786
}
7887

7988
@SubscribeEvent

0 commit comments

Comments
 (0)