Fix multiplayer crashes

This commit is contained in:
modmuss50 2019-07-31 17:34:53 +01:00
parent 398d74dedc
commit 739f4c21e8
13 changed files with 232 additions and 220 deletions

View file

@ -84,9 +84,6 @@ public class TechReborn implements ModInitializer {
// WorldGen
WorldGenerator.initBiomeFeatures();
StackToolTipHandler.setup();
StackWIPHandler.setup();
// WorldGen
// GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0);
// Register Gui Handler

View file

@ -34,6 +34,8 @@ import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.util.Identifier;
import techreborn.client.render.DynamicCellBakedModel;
import techreborn.events.StackToolTipHandler;
import techreborn.utils.StackWIPHandler;
import javax.annotation.Nullable;
import java.util.Collection;
@ -77,6 +79,9 @@ public class TechRebornClient implements ClientModInitializer {
}
};
});
StackToolTipHandler.setup();
StackWIPHandler.setup();
}

View file

@ -46,6 +46,12 @@ public class BlastFurnaceRecipe extends RebornRecipe {
heat = JsonHelper.getInt(jsonObject, "heat");
}
@Override
public void serialize(JsonObject jsonObject) {
super.serialize(jsonObject);
jsonObject.addProperty("heat", heat);
}
@Override
public boolean canCraft(final BlockEntity blockEntity) {
if (blockEntity instanceof IndustrialBlastFurnaceBlockEntity) {

View file

@ -24,15 +24,16 @@
package techreborn.client;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.screen.ScreenProviderRegistry;
import net.fabricmc.fabric.api.container.ContainerProviderRegistry;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.gui.screen.ingame.AbstractContainerScreen;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.RebornCore;
import reborncore.client.containerBuilder.IContainerProvider;
import techreborn.client.container.ContainerDestructoPack;
import techreborn.client.gui.*;
import techreborn.blockentity.ChargeOMatBlockEntity;
import techreborn.blockentity.DigitalChestBlockEntity;
import techreborn.blockentity.IndustrialCentrifugeBlockEntity;
@ -57,6 +58,8 @@ import techreborn.blockentity.storage.LowVoltageSUBlockEntity;
import techreborn.blockentity.storage.MediumVoltageSUBlockEntity;
import techreborn.blockentity.storage.idsu.InterdimensionalSUBlockEntity;
import techreborn.blockentity.storage.lesu.LapotronicSUBlockEntity;
import techreborn.client.container.ContainerDestructoPack;
import techreborn.client.gui.*;
public class GuiHandler {
@ -67,9 +70,10 @@ public class GuiHandler {
return ((IContainerProvider) blockEntity).createContainer(syncID, playerEntity);
}));
EGui.stream().forEach(gui -> ScreenProviderRegistry.INSTANCE.registerFactory(gui.getID(), (syncID, identifier, playerEntity, packetByteBuf) -> getClientGuiElement(EGui.byID(identifier), playerEntity, packetByteBuf.readBlockPos(), syncID)));
RebornCore.clientOnly(() -> () -> EGui.stream().forEach(gui -> ScreenProviderRegistry.INSTANCE.registerFactory(gui.getID(), (syncID, identifier, playerEntity, packetByteBuf) -> getClientGuiElement(EGui.byID(identifier), playerEntity, packetByteBuf.readBlockPos(), syncID))));
}
@Environment(EnvType.CLIENT)
private static AbstractContainerScreen getClientGuiElement(final EGui gui, final PlayerEntity player, BlockPos pos, int syncID) {
final BlockEntity blockEntity = player.world.getBlockEntity(pos);

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:diamond_dust",
"count": 4
}
],
"results" : [
{
"item": "minecraft:diamond",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 16
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:diamond_dust",
"count": 4
}
],
"results" : [
{
"item": "minecraft:diamond",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 16
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:emerald_dust",
"count": 4
}
],
"results" : [
{
"item": "minecraft:emerald",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:emerald_dust",
"count": 4
}
],
"results" : [
{
"item": "minecraft:emerald",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
}

View file

@ -1,23 +1,23 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:iridium_alloy_ingot"
}
],
"results" : [
{
"item": "techreborn:iridium_alloy_plate"
},
{
"item": "techreborn:dark_ashes_dust",
"count": 4
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:iridium_alloy_ingot"
}
],
"results" : [
{
"item": "techreborn:iridium_alloy_plate"
},
{
"item": "techreborn:dark_ashes_dust",
"count": 4
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:peridot_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:peridot_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:peridot_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:peridot_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "minecraft:redstone_block",
"count": 9
}
],
"results" : [
{
"item": "techreborn:red_garnet_dust",
"count": 4
},
{
"item": "techreborn:dark_ashes_dust",
"count": 4
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "minecraft:redstone_block",
"count": 9
}
],
"results" : [
{
"item": "techreborn:red_garnet_dust",
"count": 4
},
{
"item": "techreborn:dark_ashes_dust",
"count": 4
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:red_garnet_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:red_garnet_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 8
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:red_garnet_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:red_garnet_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 8
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:ruby_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:ruby_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:ruby_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:ruby_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:sapphire_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:sapphire_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:sapphire_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:sapphire_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 12
}
]
}

View file

@ -1,25 +1,25 @@
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:yellow_garnet_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:yellow_garnet_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 8
}
]
{
"type": "techreborn:implosion_compressor",
"power": 32,
"time": 20,
"ingredients" : [
{
"item": "minecraft:tnt",
"count": 16
},
{
"item": "techreborn:yellow_garnet_dust",
"count": 4
}
],
"results" : [
{
"item": "techreborn:yellow_garnet_gem",
"count": 3
},
{
"item": "techreborn:dark_ashes_dust",
"count": 8
}
]
}