Merge remote-tracking branch 'remotes/origin/1.12' into 1.13-prep

# Conflicts:
#	src/main/java/techreborn/compat/immersiveengineering/RecipeImmersiveEngineering.java
#	src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java
#	src/main/java/techreborn/init/ModRecipes.java
#	src/main/java/techreborn/packets/PacketAutoCraftingTableLock.java
This commit is contained in:
modmuss50 2018-08-03 18:04:40 +01:00
commit 53b450acea
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
158 changed files with 264 additions and 477 deletions

View file

@ -24,56 +24,46 @@
package techreborn.packets;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket;
import techreborn.tiles.tier1.TileAutoCraftingTable;
import techreborn.tiles.tier1.TileRollingMachine;
/**
* Created by modmuss50 on 20/06/2017.
*/
public class PacketSetRecipe implements INetworkPacket {
import java.io.IOException;
BlockPos pos;
ResourceLocation recipe;
boolean custom;
public class PacketAutoCraftingTableLock implements INetworkPacket {
public PacketSetRecipe(TileAutoCraftingTable tile, IRecipe recipe, boolean custom) {
this.pos = tile.getPos();
if (recipe == null) {
this.recipe = new ResourceLocation("");
} else {
this.recipe = recipe.getRegistryName();
}
this.custom = custom;
BlockPos machinePos;
boolean locked;
public PacketAutoCraftingTableLock(TileAutoCraftingTable machine, boolean locked) {
this.machinePos = machine.getPos();
this.locked = locked;
}
public PacketSetRecipe() {
public PacketAutoCraftingTableLock() {
}
@Override
public void writeData(ExtendedPacketBuffer buffer) {
buffer.writeBlockPos(pos);
buffer.writeResourceLocation(recipe);
buffer.writeBoolean(custom);
buffer.writeBlockPos(machinePos);
buffer.writeBoolean(locked);
}
@Override
public void readData(ExtendedPacketBuffer buffer) {
pos = buffer.readBlockPos();
recipe = buffer.readResourceLocation();
custom = buffer.readBoolean();
public void readData(ExtendedPacketBuffer buffer) {
machinePos = buffer.readBlockPos();
locked = buffer.readBoolean();
}
@Override
public void processData(MessageContext context) {
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(pos);
if (tileEntity instanceof TileAutoCraftingTable) {
((TileAutoCraftingTable) tileEntity).setCurrentRecipe(recipe, custom);
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(machinePos);
if(tileEntity instanceof TileAutoCraftingTable){
((TileAutoCraftingTable) tileEntity).locked = locked;
}
}
}