Skip to content

Commit

Permalink
Fix LibGui crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
falseresync committed Jul 25, 2019
1 parent b17e249 commit 7de7b46
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

archivesBaseName = "vivatech"
version = "1.0.0-alpha.11+1.14.4"
version = "1.0.0-alpha.12+1.14.4"

repositories {
jcenter()
Expand Down Expand Up @@ -42,20 +42,19 @@ dependencies {
compileOnly "com.google.code.findbugs:jsr305:3.0.2"

modApi "alexiil.mc.lib:libblockattributes-all:0.4.9"
modApi "io.github.cottonmc:LibGui:1.1.0"
modApi "io.github.cottonmc:Jankson:1.0.0+j1.1.2"
modApi ("io.github.cottonmc:LibGui:1.2.2") { transitive = false }
modApi ("io.github.cottonmc:Jankson:1.0.0+j1.1.2") { transitive = false }
modApi "io.github.cottonmc:cotton-energy:1.5.0+1.14.3-SNAPSHOT"
modApi "io.github.cottonmc:cotton-resources:1.3.3+1.14.3"

include "alexiil.mc.lib:libblockattributes-all:0.4.9"
include "io.github.cottonmc:LibGui:1.1.0"
include "io.github.cottonmc:LibGui:1.2.2"
include "io.github.cottonmc:Jankson:1.0.0+j1.1.2"
include "io.github.cottonmc:cotton-energy:1.5.0+1.14.3-SNAPSHOT"
include "io.github.cottonmc:cotton-resources:1.3.3+1.14.3"

// Integration tests
modImplementation ("me.shedaniel:RoughlyEnoughItems:2.9.7+build.140") { transitive = false }
// modImplementation ("io.github.prospector:modmenu:1.6.3+build.101") { transitive = false }
}

processResources {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/vivatech/Vivatech.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ public void onInitialize() {
VivatechItems.initialize();

ContainerProviderRegistry.INSTANCE.registerFactory(CoalGeneratorBlock.ID, (syncId, id, player, buf) ->
new CoalGeneratorController(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
new CoalGeneratorMenu(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
ContainerProviderRegistry.INSTANCE.registerFactory(CrusherBlock.ID, (syncId, id, player, buf) ->
new CrusherController(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
new CrusherMenu(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
ContainerProviderRegistry.INSTANCE.registerFactory(ElectricFurnaceBlock.ID, (syncId, id, player, buf) ->
new ElectricFurnaceController(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
new ElectricFurnaceMenu(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
ContainerProviderRegistry.INSTANCE.registerFactory(EnergyBankBlock.ID, (syncId, id, player, buf) ->
new EnergyBankController(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
new EnergyBankMenu(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
ContainerProviderRegistry.INSTANCE.registerFactory(PressBlock.ID, (syncId, id, player, buf) ->
new PressController(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));
new PressMenu(syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())));

Registry.register(CottonEnergy.ENERGY_REGISTRY, new Identifier(MODID, "infinite_voltage"), INFINITE_VOLTAGE);
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/vivatech/VivatechClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ public class VivatechClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ScreenProviderRegistry.INSTANCE.registerFactory(CoalGeneratorBlock.ID, (syncId, identifier, player, buf) ->
new CoalGeneratorScreen(new CoalGeneratorController(
new CoalGeneratorScreen(new CoalGeneratorMenu(
syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())), player));
ScreenProviderRegistry.INSTANCE.registerFactory(CrusherBlock.ID, (syncId, identifier, player, buf) ->
new CrusherScreen(new CrusherController(
new CrusherScreen(new CrusherMenu(
syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())), player));
ScreenProviderRegistry.INSTANCE.registerFactory(ElectricFurnaceBlock.ID, (syncId, identifier, player, buf) ->
new ElectricFurnaceScreen(new ElectricFurnaceController(
new ElectricFurnaceScreen(new ElectricFurnaceMenu(
syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())), player));
ScreenProviderRegistry.INSTANCE.registerFactory(EnergyBankBlock.ID, (syncId, identifier, player, buf) ->
new EnergyBankScreen(new EnergyBankController(
new EnergyBankScreen(new EnergyBankMenu(
syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())), player));
ScreenProviderRegistry.INSTANCE.registerFactory(PressBlock.ID, (syncId, identifier, player, buf) ->
new PressScreen(new PressController(
new PressScreen(new PressMenu(
syncId, player.inventory, BlockContext.create(player.world, buf.readBlockPos())), player));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import vivatech.VivatechClient;
import vivatech.util.StringHelper;

public class CoalGeneratorController extends CottonScreenController {
public class CoalGeneratorMenu extends CottonScreenController {

public CoalGeneratorController(int syncId, PlayerInventory playerInventory, BlockContext context) {
public CoalGeneratorMenu(int syncId, PlayerInventory playerInventory, BlockContext context) {
super(null, syncId, playerInventory, getBlockInventory(context), getBlockPropertyDelegate(context));

WPlainPanel root = new WPlainPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import vivatech.init.VivatechRecipes;
import vivatech.util.StringHelper;

public class CrusherController extends CottonScreenController {
public class CrusherMenu extends CottonScreenController {

public CrusherController(int syncId, PlayerInventory playerInventory, BlockContext context) {
public CrusherMenu(int syncId, PlayerInventory playerInventory, BlockContext context) {
super(VivatechRecipes.CRUSHING, syncId, playerInventory, getBlockInventory(context), getBlockPropertyDelegate(context));

WPlainPanel root = new WPlainPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import vivatech.VivatechClient;
import vivatech.util.StringHelper;

public class ElectricFurnaceController extends CottonScreenController {
public ElectricFurnaceController(int syncId, PlayerInventory playerInventory, BlockContext context) {
public class ElectricFurnaceMenu extends CottonScreenController {
public ElectricFurnaceMenu(int syncId, PlayerInventory playerInventory, BlockContext context) {
super(RecipeType.SMELTING, syncId, playerInventory, getBlockInventory(context), getBlockPropertyDelegate(context));

WPlainPanel root = new WPlainPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import vivatech.VivatechClient;
import vivatech.util.StringHelper;

public class EnergyBankController extends CottonScreenController {
public class EnergyBankMenu extends CottonScreenController {

public EnergyBankController(int syncId, PlayerInventory playerInventory, BlockContext context) {
public EnergyBankMenu(int syncId, PlayerInventory playerInventory, BlockContext context) {
super(null, syncId, playerInventory, getBlockInventory(context), getBlockPropertyDelegate(context));

WPlainPanel root = new WPlainPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import vivatech.init.VivatechRecipes;
import vivatech.util.StringHelper;

public class PressController extends CottonScreenController {
public class PressMenu extends CottonScreenController {

public PressController(int syncId, PlayerInventory playerInventory, BlockContext context) {
public PressMenu(int syncId, PlayerInventory playerInventory, BlockContext context) {
super(VivatechRecipes.PRESSING, syncId, playerInventory, getBlockInventory(context), getBlockPropertyDelegate(context));

WPlainPanel root = new WPlainPanel();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vivatech/screen/CoalGeneratorScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import io.github.cottonmc.cotton.gui.widget.WLabel;
import net.minecraft.entity.player.PlayerEntity;
import vivatech.block.CoalGeneratorBlock;
import vivatech.menu.CoalGeneratorController;
import vivatech.menu.CoalGeneratorMenu;
import vivatech.util.StringHelper;

public class CoalGeneratorScreen extends CottonScreen<CoalGeneratorController> {
public CoalGeneratorScreen(CoalGeneratorController container, PlayerEntity player) {
public class CoalGeneratorScreen extends CottonScreen<CoalGeneratorMenu> {
public CoalGeneratorScreen(CoalGeneratorMenu container, PlayerEntity player) {
super(container, player);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vivatech/screen/CrusherScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import io.github.cottonmc.cotton.gui.widget.WLabel;
import net.minecraft.entity.player.PlayerEntity;
import vivatech.block.CrusherBlock;
import vivatech.menu.CrusherController;
import vivatech.menu.CrusherMenu;
import vivatech.util.StringHelper;

public class CrusherScreen extends CottonScreen<CrusherController> {
public CrusherScreen(CrusherController container, PlayerEntity player) {
public class CrusherScreen extends CottonScreen<CrusherMenu> {
public CrusherScreen(CrusherMenu container, PlayerEntity player) {
super(container, player);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vivatech/screen/ElectricFurnaceScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import io.github.cottonmc.cotton.gui.widget.WLabel;
import net.minecraft.entity.player.PlayerEntity;
import vivatech.block.ElectricFurnaceBlock;
import vivatech.menu.ElectricFurnaceController;
import vivatech.menu.ElectricFurnaceMenu;
import vivatech.util.StringHelper;

public class ElectricFurnaceScreen extends CottonScreen<ElectricFurnaceController> {
public ElectricFurnaceScreen(ElectricFurnaceController container, PlayerEntity player) {
public class ElectricFurnaceScreen extends CottonScreen<ElectricFurnaceMenu> {
public ElectricFurnaceScreen(ElectricFurnaceMenu container, PlayerEntity player) {
super(container, player);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vivatech/screen/EnergyBankScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import net.minecraft.entity.player.PlayerEntity;
import vivatech.VivatechClient;
import vivatech.block.EnergyBankBlock;
import vivatech.menu.EnergyBankController;
import vivatech.menu.EnergyBankMenu;
import vivatech.util.StringHelper;

public class EnergyBankScreen extends CottonScreen<EnergyBankController> {
public EnergyBankScreen(EnergyBankController container, PlayerEntity player) {
public class EnergyBankScreen extends CottonScreen<EnergyBankMenu> {
public EnergyBankScreen(EnergyBankMenu container, PlayerEntity player) {
super(container, player);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/vivatech/screen/PressScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import io.github.cottonmc.cotton.gui.widget.WLabel;
import net.minecraft.entity.player.PlayerEntity;
import vivatech.block.PressBlock;
import vivatech.menu.PressController;
import vivatech.menu.PressMenu;
import vivatech.util.StringHelper;

public class PressScreen extends CottonScreen<PressController> {
public PressScreen(PressController container, PlayerEntity player) {
public class PressScreen extends CottonScreen<PressMenu> {
public PressScreen(PressMenu container, PlayerEntity player) {
super(container, player);
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"fabricloader": ">=0.4.0",
"fabric": "*",
"jankson": "*",
"libgui": ">=1.2.2",
"cotton-energy": ">=1.4.0+1.14.2",
"cotton-resources": ">=1.3.2+1.14.3",
"libblockattributes": ">=0.4.9"
Expand Down

0 comments on commit 7de7b46

Please sign in to comment.