Support RC changes
This commit is contained in:
parent
e0f63fd0c5
commit
fc4d8686b8
10 changed files with 46 additions and 48 deletions
|
@ -42,7 +42,6 @@ import reborncore.api.recipe.RecipeHandler;
|
|||
import reborncore.common.multiblock.MultiblockEventHandler;
|
||||
import reborncore.common.multiblock.MultiblockServerTickHandler;
|
||||
import reborncore.common.network.RegisterPacketEvent;
|
||||
import reborncore.common.packets.AddDiscriminatorEvent;
|
||||
import reborncore.common.util.LogHelper;
|
||||
import reborncore.common.util.VersionChecker;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
|
@ -219,15 +218,11 @@ public class Core {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void addDiscriminator(AddDiscriminatorEvent event) {
|
||||
event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketAesu.class);
|
||||
event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketIdsu.class);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void LoadPackets(RegisterPacketEvent event){
|
||||
event.registerPacket(PacketSyncSideConfig.class, Side.SERVER);
|
||||
event.registerPacket(PacketAesu.class, Side.SERVER);
|
||||
event.registerPacket(PacketIdsu.class, Side.SERVER);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.packets.PacketHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerAESU;
|
||||
import techreborn.packets.PacketAesu;
|
||||
|
@ -90,6 +90,6 @@ public class GuiAESU extends GuiContainer {
|
|||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu));
|
||||
NetworkManager.sendToServer(new PacketAesu(button.id, aesu));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import reborncore.common.packets.PacketHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.client.container.ContainerIDSU;
|
||||
import techreborn.packets.PacketIdsu;
|
||||
|
@ -111,8 +111,8 @@ public class GuiIDSU extends GuiContainer {
|
|||
@Override
|
||||
protected void actionPerformed(GuiButton button) throws IOException {
|
||||
super.actionPerformed(button);
|
||||
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu));
|
||||
NetworkManager.sendToServer(new PacketIdsu(button.id, idsu));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ import techreborn.blocks.transformers.BlockHVTransformer;
|
|||
import techreborn.blocks.transformers.BlockLVTransformer;
|
||||
import techreborn.blocks.transformers.BlockMVTransformer;
|
||||
import techreborn.itemblocks.*;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.tiles.*;
|
||||
import techreborn.tiles.cable.TileCable;
|
||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||
|
@ -214,9 +213,9 @@ public class ModBlocks {
|
|||
registerBlock(CABLE, ItemBlockCable.class, "cable");
|
||||
GameRegistry.registerTileEntity(TileCable.class, "TileCableTR");
|
||||
Core.proxy.registerCustomBlockStateLocation(CABLE, "cable");
|
||||
for (EnumCableType cableType : EnumCableType.values()) {
|
||||
Core.proxy.registerSubBlockInventoryLocation(CABLE, cableType.ordinal(), "techreborn:cable", "type=inv_" + cableType.getName().toLowerCase());
|
||||
}
|
||||
// for (EnumCableType cableType : EnumCableType.values()) {
|
||||
// Core.proxy.registerSubBlockInventoryLocation(CABLE, cableType.ordinal(), "techreborn:cable", "type=inv_" + cableType.getName().toLowerCase());
|
||||
// }
|
||||
|
||||
MACHINE_CASINGS = new BlockMachineCasing(Material.ROCK);
|
||||
registerBlock(MACHINE_CASINGS, ItemBlockMachineCasing.class, "machinecasing");
|
||||
|
|
|
@ -24,41 +24,43 @@
|
|||
|
||||
package techreborn.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import reborncore.common.packets.SimplePacket;
|
||||
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.TileAesu;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PacketAesu extends SimplePacket {
|
||||
public class PacketAesu implements INetworkPacket<PacketAesu> {
|
||||
|
||||
int buttonID;
|
||||
TileAesu aesu;
|
||||
BlockPos pos;
|
||||
|
||||
public PacketAesu() {
|
||||
}
|
||||
|
||||
public PacketAesu(int buttonID, TileAesu aesu) {
|
||||
this.aesu = aesu;
|
||||
public PacketAesu(int buttonID, TileAesu tile) {
|
||||
this.pos = tile.getPos();
|
||||
this.buttonID = buttonID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(ByteBuf out) throws IOException {
|
||||
SimplePacket.writeTileEntity(aesu, out);
|
||||
public void writeData(ExtendedPacketBuffer out) throws IOException {
|
||||
out.writeBlockPos(pos);
|
||||
out.writeInt(buttonID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(ByteBuf in) throws IOException {
|
||||
this.aesu = (TileAesu) SimplePacket.readTileEntity(in);
|
||||
public void readData(ExtendedPacketBuffer in) throws IOException {
|
||||
this.pos = in.readBlockPos();
|
||||
buttonID = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!aesu.getWorld().isRemote) {
|
||||
aesu.handleGuiInputFromClient(buttonID);
|
||||
}
|
||||
public void processData(PacketAesu message, MessageContext context) {
|
||||
// if (!pos.getWorld().isRemote) {
|
||||
// pos.handleGuiInputFromClient(buttonID);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,41 +24,43 @@
|
|||
|
||||
package techreborn.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import reborncore.common.packets.SimplePacket;
|
||||
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.idsu.TileIDSU;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class PacketIdsu extends SimplePacket {
|
||||
public class PacketIdsu implements INetworkPacket<PacketIdsu> {
|
||||
|
||||
int buttonID;
|
||||
TileIDSU idsu;
|
||||
BlockPos pos;
|
||||
|
||||
public PacketIdsu() {
|
||||
}
|
||||
|
||||
public PacketIdsu(int buttonID, TileIDSU aesu) {
|
||||
this.idsu = aesu;
|
||||
public PacketIdsu(int buttonID, TileIDSU tile) {
|
||||
this.pos = tile.getPos();
|
||||
this.buttonID = buttonID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeData(ByteBuf out) throws IOException {
|
||||
SimplePacket.writeTileEntity(idsu, out);
|
||||
public void writeData(ExtendedPacketBuffer out) throws IOException {
|
||||
out.writeBlockPos(pos);
|
||||
out.writeInt(buttonID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(ByteBuf in) throws IOException {
|
||||
this.idsu = (TileIDSU) SimplePacket.readTileEntity(in);
|
||||
public void readData(ExtendedPacketBuffer in) throws IOException {
|
||||
this.pos = in.readBlockPos();
|
||||
buttonID = in.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!idsu.getWorld().isRemote) {
|
||||
// idsu.handleGuiInputFromClient(buttonID);
|
||||
}
|
||||
public void processData(PacketIdsu message, MessageContext context) {
|
||||
// if (!pos.getWorld().isRemote) {
|
||||
// pos.handleGuiInputFromClient(buttonID);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ tile.techreborn.alloyfurnace.name=Iron Alloy Furnace
|
|||
tile.techreborn.chemicalreactor.name=Chemical Reactor
|
||||
tile.techreborn.dragoneggsiphoner.name=Dragon Egg Energy Siphon
|
||||
tile.techreborn.idsu.name=IDSU
|
||||
tile.techreborn.aesu.name=AESU
|
||||
tile.techreborn.pos.name=AESU
|
||||
tile.techreborn.lesu.name=LESU
|
||||
tile.techreborn.lesustorage.name=LESU Block
|
||||
tile.techreborn.distillationtower.name=Distillation Tower
|
||||
|
|
|
@ -29,7 +29,7 @@ tile.techreborn.alloyfurnace.name=Four en fer d'alliage
|
|||
tile.techreborn.chemicalreactor.name=Réacteur chimique
|
||||
tile.techreborn.dragoneggsiphoner.name=Syphon d'énergie d'oeuf de dragon
|
||||
tile.techreborn.idsu.name=USID
|
||||
tile.techreborn.aesu.name=USEA
|
||||
tile.techreborn.pos.name=USEA
|
||||
tile.techreborn.lesu.name=USEL
|
||||
tile.techreborn.lesustorage.name=Stockage USEL
|
||||
tile.techreborn.distillationtower.name=Tour de distillation
|
||||
|
|
|
@ -30,7 +30,7 @@ tile.techreborn.alloyfurnace.name=Железная сплавовая печь
|
|||
tile.techreborn.chemicalreactor.name=Химический реактор
|
||||
tile.techreborn.dragoneggsiphoner.name=Сифон энергии драконьего яйца
|
||||
tile.techreborn.idsu.name=IDSU
|
||||
tile.techreborn.aesu.name=AESU
|
||||
tile.techreborn.pos.name=AESU
|
||||
tile.techreborn.lesu.name=LESU
|
||||
tile.techreborn.lesustorage.name=Блок LESU
|
||||
tile.techreborn.distillationtower.name=Дистилляционная труба
|
||||
|
|
|
@ -31,7 +31,7 @@ tile.techreborn.alloyfurnace.name=铁制合金冶炼炉
|
|||
tile.techreborn.chemicalreactor.name=化学反应器
|
||||
tile.techreborn.dragoneggsiphoner.name=龙蛋能源吸取器
|
||||
tile.techreborn.idsu.name=IDSU
|
||||
tile.techreborn.aesu.name=AESU
|
||||
tile.techreborn.pos.name=AESU
|
||||
tile.techreborn.lesu.name=LESU
|
||||
tile.techreborn.lesustorage.name=LESU方块
|
||||
tile.techreborn.distillationtower.name=蒸馏塔
|
||||
|
|
Loading…
Add table
Reference in a new issue