Skip to content

Commit

Permalink
Rename BW packets to be more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune committed Sep 28, 2024
1 parent a3b3e1b commit f4d818b
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
import gregtech.api.net.GTPacket;
import io.netty.buffer.ByteBuf;

public class MetaBlockPacket extends GTPacket {
public class PacketBWMetaBlock extends GTPacket {

int x;
short y;
int z;
short meta;

public MetaBlockPacket(int x, int y, int z, int meta) {
public PacketBWMetaBlock(int x, int y, int z, int meta) {
super();
this.x = x;
this.y = (short) y;
this.z = z;
this.meta = (short) meta;
}

public MetaBlockPacket() {
public PacketBWMetaBlock() {
super();
}

Expand Down Expand Up @@ -76,7 +76,7 @@ public GTPacket decode(ByteArrayDataInput byteArrayDataInput) {
this.z = byteArrayDataInput.readInt();
this.y = byteArrayDataInput.readShort();
this.meta = byteArrayDataInput.readShort();
MetaBlockPacket todecode = new MetaBlockPacket(this.x, this.y, this.z, this.meta);
PacketBWMetaBlock todecode = new PacketBWMetaBlock(this.x, this.y, this.z, this.meta);
if (byteArrayDataInput.readInt() != MurmurHash3.murmurhash3_x86_32(
ByteBuffer.allocate(12)
.putInt(this.x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
import gregtech.api.net.GTPacket;
import io.netty.buffer.ByteBuf;

public class RendererPacket extends GTPacket {
public class PacketBioVatRenderer extends GTPacket {

private Coords coords;
private int integer;
private byte removal;

public RendererPacket() {
public PacketBioVatRenderer() {
super();
}

public RendererPacket(Coords coords, int integer, boolean removal) {
public PacketBioVatRenderer(Coords coords, int integer, boolean removal) {
super();
this.coords = coords;
this.integer = integer;
Expand Down Expand Up @@ -86,7 +86,7 @@ public GTPacket decode(ByteArrayDataInput dataInput) {
return null;
}

return new RendererPacket(this.coords, this.integer, this.removal == 1);
return new PacketBioVatRenderer(this.coords, this.integer, this.removal == 1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
import gregtech.api.net.GTPacket;
import io.netty.buffer.ByteBuf;

public class EICPacket extends GTPacket {
public class PacketEIC extends GTPacket {

private Coords coords;
private boolean bool;

public EICPacket() {
public PacketEIC() {
super();
}

public EICPacket(Coords coords, boolean bool) {
public PacketEIC(Coords coords, boolean bool) {
super();
this.coords = coords;
this.bool = bool;
Expand All @@ -43,7 +43,7 @@ public void encode(ByteBuf aOut) {

@Override
public GTPacket decode(ByteArrayDataInput aData) {
return new EICPacket(new Coords(aData.readInt(), aData.readInt(), aData.readInt()), aData.readBoolean());
return new PacketEIC(new Coords(aData.readInt(), aData.readInt(), aData.readInt()), aData.readBoolean());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
import gregtech.api.net.GTPacket;
import io.netty.buffer.ByteBuf;

public class OreDictCachePacket extends GTPacket {
public class PacketOreDictCache extends GTPacket {

private HashSet<Pair<Integer, Short>> hashSet = new HashSet<>();

public OreDictCachePacket() {
public PacketOreDictCache() {
super();
}

public OreDictCachePacket(HashSet<Pair<Integer, Short>> set) {
public PacketOreDictCache(HashSet<Pair<Integer, Short>> set) {
super();
this.hashSet = set;
}
Expand All @@ -58,7 +58,7 @@ public GTPacket decode(ByteArrayDataInput byteArrayDataInput) {
for (int i = 0; i < size; i++) {
this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(), byteArrayDataInput.readShort()));
}
return new OreDictCachePacket(this.hashSet);
return new PacketOreDictCache(this.hashSet);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
import gregtech.api.net.GTPacket;
import io.netty.buffer.ByteBuf;

public class ServerJoinedPacket extends GTPacket {
public class PacketServerJoined extends GTPacket {

private byte config;

public ServerJoinedPacket() {
public PacketServerJoined() {
super();
}

public ServerJoinedPacket(Object obj) {
public PacketServerJoined(Object obj) {
super();
this.config = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import bartworks.common.configs.Configuration;
import bartworks.common.items.ItemLabParts;
import bartworks.common.loaders.FluidLoader;
import bartworks.common.net.RendererPacket;
import bartworks.common.net.PacketBioVatRenderer;
import bartworks.common.tileentities.tiered.GT_MetaTileEntity_RadioHatch;
import bartworks.util.BWUtil;
import bartworks.util.BioCulture;
Expand Down Expand Up @@ -393,7 +393,7 @@ private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCultur
GTValues.NW.sendPacketToAllPlayersInRange(
this.getBaseMetaTileEntity()
.getWorld(),
new RendererPacket(
new PacketBioVatRenderer(
new Coords(
xDir + x
+ this.getBaseMetaTileEntity()
Expand All @@ -414,7 +414,7 @@ private void sendPackagesOrRenewRenderer(int x, int y, int z, BioCulture lCultur
GTValues.NW.sendPacketToAllPlayersInRange(
this.getBaseMetaTileEntity()
.getWorld(),
new RendererPacket(
new PacketBioVatRenderer(
new Coords(
xDir + x
+ this.getBaseMetaTileEntity()
Expand Down Expand Up @@ -706,7 +706,7 @@ private void sendRenderPackets(int xDir, int zDir) {
GTValues.NW.sendPacketToAllPlayersInRange(
this.getBaseMetaTileEntity()
.getWorld(),
new RendererPacket(
new PacketBioVatRenderer(
new Coords(
xDir + x
+ this.getBaseMetaTileEntity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import bartworks.API.recipe.BartWorksRecipeMaps;
import bartworks.client.renderer.EICPistonVisualizer;
import bartworks.common.configs.Configuration;
import bartworks.common.net.EICPacket;
import bartworks.common.net.PacketEIC;
import bartworks.util.Coords;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -354,7 +354,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isClientSide()) this.animatePiston(aBaseMetaTileEntity);
else if (aBaseMetaTileEntity.hasMufflerUpgrade()) GTValues.NW.sendPacketToAllPlayersInRange(
aBaseMetaTileEntity.getWorld(),
new EICPacket(
new PacketEIC(
new Coords(
aBaseMetaTileEntity.getXCoord(),
aBaseMetaTileEntity.getYCoord(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import net.minecraftforge.oredict.OreDictionary;

import bartworks.API.SideReference;
import bartworks.common.net.OreDictCachePacket;
import bartworks.common.net.ServerJoinedPacket;
import bartworks.common.net.PacketOreDictCache;
import bartworks.common.net.PacketServerJoined;
import bartworks.system.material.Werkstoff;
import bartworks.system.oredict.OreDictHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
Expand All @@ -36,8 +36,8 @@ public class ServerEventHandler {
@SubscribeEvent(priority = EventPriority.LOWEST)
public void EntityJoinWorldEvent(EntityJoinWorldEvent event) {
if (event == null || !(event.entity instanceof EntityPlayerMP) || !SideReference.Side.Server) return;
GTValues.NW.sendToPlayer(new OreDictCachePacket(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity);
GTValues.NW.sendToPlayer(new ServerJoinedPacket(null), (EntityPlayerMP) event.entity);
GTValues.NW.sendToPlayer(new PacketOreDictCache(OreDictHandler.getNonBWCache()), (EntityPlayerMP) event.entity);
GTValues.NW.sendToPlayer(new PacketServerJoined(null), (EntityPlayerMP) event.entity);
}

// FMLCommonHandler.instance().bus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import net.minecraft.network.Packet;
import net.minecraft.tileentity.TileEntity;

import bartworks.common.net.MetaBlockPacket;
import bartworks.common.net.PacketBWMetaBlock;
import gregtech.api.enums.GTValues;
import gregtech.api.interfaces.tileentity.ITexturedTileEntity;

Expand Down Expand Up @@ -51,7 +51,7 @@ public void writeToNBT(NBTTagCompound aNBT) {
public Packet getDescriptionPacket() {
if (!this.worldObj.isRemote) GTValues.NW.sendPacketToAllPlayersInRange(
this.worldObj,
new MetaBlockPacket(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData),
new PacketBWMetaBlock(this.xCoord, (short) this.yCoord, this.zCoord, this.mMetaData),
this.xCoord,
this.zCoord);
return null;
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/gregtech/api/net/GTPacketTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.util.Arrays;

import bartworks.common.net.EICPacket;
import bartworks.common.net.MetaBlockPacket;
import bartworks.common.net.OreDictCachePacket;
import bartworks.common.net.RendererPacket;
import bartworks.common.net.ServerJoinedPacket;
import bartworks.common.net.PacketBWMetaBlock;
import bartworks.common.net.PacketBioVatRenderer;
import bartworks.common.net.PacketEIC;
import bartworks.common.net.PacketOreDictCache;
import bartworks.common.net.PacketServerJoined;
import gregtech.common.blocks.PacketOres;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;

Expand All @@ -30,11 +30,11 @@ public enum GTPacketTypes {
TOOL_SWITCH_MODE(20, new GTPacketToolSwitchMode()),
MUSIC_SYSTEM_DATA(21, new GTPacketMusicSystemData()),
INFINITE_SPRAYCAN(22, new GTPacketInfiniteSpraycan()),
BIO_VAT_RENDERER(23, new RendererPacket()),
BW_META_BLOCK(24, new MetaBlockPacket()),
ORE_DICT_CACHE(25, new OreDictCachePacket()),
SERVER_JOINED(26, new ServerJoinedPacket()),
EIC(27, new EICPacket()),
BIO_VAT_RENDERER(23, new PacketBioVatRenderer()),
BW_META_BLOCK(24, new PacketBWMetaBlock()),
ORE_DICT_CACHE(25, new PacketOreDictCache()),
SERVER_JOINED(26, new PacketServerJoined()),
EIC(27, new PacketEIC()),
// merge conflict prevention comment, keep a trailing comma above
;

Expand Down

0 comments on commit f4d818b

Please sign in to comment.