Skip to content

Commit 543787e

Browse files
committed
Update to 7.1-pre1a!
1 parent ac8fe78 commit 543787e

12 files changed

+183
-72
lines changed

build.gradle

+4-5
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,15 @@ dependencies {
8585
// If you do not need Halplibe you can comment this line out or delete this line
8686
modImplementation "bta-halplibe:halplibe:${project.halplibe_version}"
8787

88-
modImplementation "ModMenu:ModMenu:2.0.0"
88+
modImplementation "ModMenu:ModMenu:2.0.3"
8989

90-
modImplementation "sunsetutils:sunsetutils:1.9.1"
91-
modImplementation "guidebookpp:guidebookpp:1.5.7"
90+
modImplementation "catalyst:catalyst-core:1.1.1"
9291

9392
implementation "org.slf4j:slf4j-api:1.8.0-beta4"
9493
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
9594

96-
implementation 'com.google.guava:guava:30.0-jre'
97-
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
95+
implementation 'com.google.guava:guava:33.0.0-jre'
96+
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
9897

9998
implementation("org.apache.commons:commons-lang3:3.12.0")
10099

gradle.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
org.gradle.jvmargs=-Xmx2G
22

33
# BTA
4-
bta_version=1.7.7.0_02
4+
bta_version=7.1-pre1a
55

66
# Loader
7-
loader_version=0.14.19-babric.1-bta
7+
loader_version=0.14.19-babric.3-bta
88

99
# HalpLibe
10-
halplibe_version=2.8.0
10+
halplibe_version=3.1.2
1111

1212
# Mod
13-
mod_version=1.0.1
13+
mod_version=1.0.2
1414
mod_group=sunsetsatellite
1515
mod_name=computers

src/main/java/dan200/client/GuiComputer.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,25 @@ public GuiComputer(TileEntityComputer tileentitycomputer) {
2828
this.m_rebootTimer = 0.0F;
2929
}
3030

31-
public void initGui() {
32-
super.initGui();
31+
public void init() {
32+
super.init();
3333
Keyboard.enableRepeatEvents(true);
3434
this.m_terminateTimer = 0.0F;
3535
this.m_rebootTimer = 0.0F;
3636
}
3737

38-
public void onGuiClosed() {
39-
super.onGuiClosed();
38+
public void onClosed() {
39+
super.onClosed();
4040
Keyboard.enableRepeatEvents(false);
4141
}
4242

43-
public boolean doesGuiPauseGame() {
43+
@Override
44+
public boolean pausesGame() {
4445
return false;
4546
}
4647

47-
public void updateScreen() {
48-
super.updateScreen();
48+
public void tick() {
49+
super.tick();
4950
if (this.m_computer.isDestroyed()) {
5051
this.mc.displayGuiScreen(null);
5152
return;

src/main/java/dan200/shared/BlockComputer.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class BlockComputer extends BlockTileEntityRotatable {
3737

3838
public BlockComputer(String id, int i) {
3939
super(id, i, Material.stone);
40-
setTickOnLoad(true);
40+
setTicking(true);
4141
}
4242

4343
public void onBlockAdded(World world, int i, int j, int k) {
@@ -155,11 +155,12 @@ public int tickRate() {
155155
return 1;
156156
}
157157

158-
public void onBlockRemoval(World world, int i, int j, int k) {
158+
@Override
159+
public void onBlockRemoved(World world, int i, int j, int k, int data) {
159160
TileEntityComputer computer = (TileEntityComputer) world.getBlockTileEntity(i, j, k);
160161
if (computer != null)
161162
computer.destroy();
162-
super.onBlockRemoval(world, i, j, k);
163+
super.onBlockRemoved(world, i, j, k, data);
163164
}
164165

165166
@Override

src/main/java/dan200/shared/BlockDiskDrive.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ public BlockDiskDrive(String id, int i) {
3333
super(id, i, Material.stone);
3434
}
3535

36-
public void onBlockRemoval(World world, int i, int j, int k) {
36+
@Override
37+
public void onBlockRemoved(World world, int i, int j, int k, int data) {
3738
TileEntityDiskDrive drive = (TileEntityDiskDrive) world.getBlockTileEntity(i, j, k);
3839
if (drive != null) {
3940
drive.ejectContents(true);
4041
}
41-
super.onBlockRemoval(world, i, j, k);
42+
super.onBlockRemoved(world, i, j, k, data);
4243
}
4344

4445
@Override

src/main/java/dan200/shared/ItemDisk.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import net.minecraft.core.item.Item;
1212
import net.minecraft.core.item.ItemStack;
1313
import net.minecraft.core.world.World;
14+
import sunsetsatellite.catalyst.core.util.ICustomDescription;
1415
import sunsetsatellite.computers.Computers;
1516
import sunsetsatellite.computers.packets.PacketComputers;
16-
import sunsetsatellite.sunsetutils.util.ICustomDescription;
1717

1818
import java.io.*;
1919
import java.lang.ref.WeakReference;
@@ -84,7 +84,7 @@ public Computer getOwner() {
8484

8585
@Override
8686
public void execute() {
87-
ItemDisk.loadLabels((World) labelWorld.get());
87+
//ItemDisk.loadLabels((World) labelWorld.get());
8888
}
8989
}, null
9090
);

src/main/java/dan200/shared/TileEntityComputer.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void validate() {
4141
if (Computers.isMultiplayerClient()) {
4242
PacketComputers packet = new PacketComputers();
4343
packet.packetType = 5;
44-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord};
44+
packet.dataInt = new int[]{this.x, this.y, this.z};
4545
Computers.sendToServer(packet);
4646
}
4747
}
@@ -66,13 +66,13 @@ public boolean isDestroyed() {
6666
/*
6767
// WARNING - Removed try catching itself - possible behaviour change.
6868
*/
69-
public void updateEntity() {
69+
public void tick() {
7070
double dt = 0.05;
7171
if (!Computers.isMultiplayerClient()) {
7272
PacketComputers packet;
7373
this.m_computer.advance(dt);
7474
if (this.m_computer.pollChanged()) {
75-
Computers.notifyBlockChange(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Computers.computer.id);
75+
Computers.notifyBlockChange(this.worldObj, this.x, this.y, this.z, Computers.computer.id);
7676
if (Computers.isMultiplayerServer()) {
7777
packet = this.createOutputChangedPacket();
7878
Computers.sendToAllPlayers(packet);
@@ -126,7 +126,7 @@ public void keyTyped(char ch, int key) {
126126
} else {
127127
PacketComputers packet = new PacketComputers();
128128
packet.packetType = 2;
129-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord, key};
129+
packet.dataInt = new int[]{this.x, this.y, this.z, key};
130130
packet.dataString = new String[]{"" + ch};
131131
Computers.sendToServer(packet);
132132
}
@@ -138,7 +138,7 @@ public void terminate() {
138138
} else {
139139
PacketComputers packet = new PacketComputers();
140140
packet.packetType = 6;
141-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord};
141+
packet.dataInt = new int[]{this.x, this.y, this.z};
142142
Computers.sendToServer(packet);
143143
}
144144
}
@@ -149,7 +149,7 @@ public void reboot() {
149149
} else {
150150
PacketComputers packet = new PacketComputers();
151151
packet.packetType = 9;
152-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord};
152+
packet.dataInt = new int[]{this.x, this.y, this.z};
153153
Computers.sendToServer(packet);
154154
}
155155
}
@@ -160,7 +160,7 @@ public void shutdown() {
160160
} else {
161161
PacketComputers packet = new PacketComputers();
162162
packet.packetType = 12;
163-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord};
163+
packet.dataInt = new int[]{this.x, this.y, this.z};
164164
Computers.sendToServer(packet);
165165
}
166166
}
@@ -233,13 +233,13 @@ public void playRecord(String record) {
233233
if (Computers.isMultiplayerServer()) {
234234
PacketComputers packet = new PacketComputers();
235235
packet.packetType = 7;
236-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord};
236+
packet.dataInt = new int[]{this.x, this.y, this.z};
237237
if (record != null) {
238238
packet.dataString = new String[]{record};
239239
}
240240
Computers.sendToAllPlayers(packet);
241241
} else {
242-
this.worldObj.playRecord(record, this.xCoord, this.yCoord, this.zCoord);
242+
this.worldObj.playRecord(record, this.x, this.y, this.z);
243243
}
244244
}
245245

@@ -252,9 +252,9 @@ private void tryEjectDisk(int targetSide, int testSide, int i, int j, int k) {
252252

253253
public void ejectDisk(int side) {
254254
if (!Computers.isMultiplayerClient()) {
255-
int i = this.xCoord;
256-
int j = this.yCoord;
257-
int k = this.zCoord;
255+
int i = this.x;
256+
int j = this.y;
257+
int k = this.z;
258258
int m = this.worldObj.getBlockMetadata(i, j, k);
259259
this.tryEjectDisk(side, BlockComputer.getLocalSide(0, m), i, j + 1, k);
260260
this.tryEjectDisk(side, BlockComputer.getLocalSide(1, m), i, j - 1, k);
@@ -281,7 +281,7 @@ private PacketComputers createTerminalChangedPacket(boolean _includeAllText) {
281281
}
282282
PacketComputers packet = new PacketComputers();
283283
packet.packetType = 3;
284-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord, this.m_terminal.getCursorX(), this.m_terminal.getCursorY(), lineChangeMask};
284+
packet.dataInt = new int[]{this.x, this.y, this.z, this.m_terminal.getCursorX(), this.m_terminal.getCursorY(), lineChangeMask};
285285
packet.dataString = new String[lineChangeCount];
286286
int n = 0;
287287
for (int y = 0; y < this.m_terminal.getHeight(); ++y) {
@@ -306,7 +306,7 @@ private PacketComputers createOutputChangedPacket() {
306306
if (!this.m_computer.getOutput(i)) continue;
307307
flags += 1 << i + 2;
308308
}
309-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord, flags, this.m_computer.getBundledOutput(0), this.m_computer.getBundledOutput(1), this.m_computer.getBundledOutput(2), this.m_computer.getBundledOutput(3), this.m_computer.getBundledOutput(3), this.m_computer.getBundledOutput(5)};
309+
packet.dataInt = new int[]{this.x, this.y, this.z, flags, this.m_computer.getBundledOutput(0), this.m_computer.getBundledOutput(1), this.m_computer.getBundledOutput(2), this.m_computer.getBundledOutput(3), this.m_computer.getBundledOutput(3), this.m_computer.getBundledOutput(5)};
310310
return packet;
311311
}
312312

@@ -375,7 +375,7 @@ public void handlePacket(PacketComputers packet, EntityPlayer player) {
375375
this.m_clientData.output[i] = (flags & 1 << i + 2) > 0;
376376
this.m_clientData.bundledOutput[i] = packet.dataInt[4 + i];
377377
}
378-
Computers.notifyBlockChange(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Computers.computer.id);
378+
Computers.notifyBlockChange(this.worldObj, this.x, this.y, this.z, Computers.computer.id);
379379
break;
380380
}
381381
case 7: {

src/main/java/dan200/shared/TileEntityDiskDrive.java

+18-13
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void validate() {
3333
if (Computers.isMultiplayerClient()) {
3434
PacketComputers packet = new PacketComputers();
3535
packet.packetType = 5;
36-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord};
36+
packet.dataInt = new int[]{this.x, this.y, this.z};
3737
Computers.sendToServer(packet);
3838
}
3939
}
@@ -64,7 +64,7 @@ public void setInventorySlotContents(int i, ItemStack itemstack) {
6464
boolean hadDisk = this.hasDisk();
6565
this.diskStack = itemstack;
6666
if (!Computers.isMultiplayerClient()) {
67-
Computers.notifyBlockChange(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Computers.diskDrive.id);
67+
Computers.notifyBlockChange(this.worldObj, this.x, this.y, this.z, Computers.diskDrive.id);
6868
if (Computers.isMultiplayerServer()) {
6969
int newDiskLight = 0;
7070
if (this.hasAnything()) {
@@ -109,10 +109,15 @@ public int getInventoryStackLimit() {
109109

110110
@Override
111111
public boolean canInteractWith(EntityPlayer entityplayer) {
112-
if (this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this) {
112+
if (this.worldObj.getBlockTileEntity(this.x, this.y, this.z) != this) {
113113
return false;
114114
}
115-
return entityplayer.distanceTo((double) this.xCoord + 0.5, (double) this.yCoord + 0.5, (double) this.zCoord + 0.5) <= 64.0;
115+
return entityplayer.distanceTo((double) this.x + 0.5, (double) this.y + 0.5, (double) this.z + 0.5) <= 64.0;
116+
}
117+
118+
@Override
119+
public void sortInventory() {
120+
116121
}
117122

118123
public boolean hasAnything() {
@@ -139,7 +144,7 @@ public void ejectContents(boolean destroyed) {
139144
int xOff = 0;
140145
int zOff = 0;
141146
if (!destroyed) {
142-
int metaData = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
147+
int metaData = this.worldObj.getBlockMetadata(this.x, this.y, this.z);
143148
switch (metaData) {
144149
case 2: {
145150
zOff = -1;
@@ -159,16 +164,16 @@ public void ejectContents(boolean destroyed) {
159164
}
160165
}
161166
}
162-
double x = (double) this.xCoord + 0.5 + (double) xOff * 0.5;
163-
double y = (double) this.yCoord + 0.75;
164-
double z = (double) this.zCoord + 0.5 + (double) zOff * 0.5;
167+
double x = (double) this.x + 0.5 + (double) xOff * 0.5;
168+
double y = (double) this.y + 0.75;
169+
double z = (double) this.z + 0.5 + (double) zOff * 0.5;
165170
EntityItem entityitem = new EntityItem(this.worldObj, x, y, z, disks);
166171
entityitem.xd = (double) xOff * 0.15;
167172
entityitem.yd = 0.0;
168173
entityitem.zd = (double) zOff * 0.15;
169174
this.worldObj.entityJoinedWorld(entityitem);
170175
if (!destroyed) {
171-
this.worldObj.playSoundEffect(1000, this.xCoord, this.yCoord, this.zCoord, 0);
176+
this.worldObj.playSoundEffect(1000, this.x, this.y, this.z, 0);
172177
}
173178
}
174179
}
@@ -189,14 +194,14 @@ public String getAudioDiscRecordName() {
189194
return null;
190195
}
191196

192-
public void updateEntity() {
197+
public void tick() {
193198
if (this.m_firstFrame) {
194199
if (!Computers.isMultiplayerClient()) {
195200
this.m_clientDiskLight = 0;
196201
if (this.hasAnything()) {
197202
this.m_clientDiskLight = this.hasDisk() ? 1 : 2;
198203
}
199-
Computers.notifyBlockChange(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Computers.diskDrive.id);
204+
Computers.notifyBlockChange(this.worldObj, this.x, this.y, this.z, Computers.diskDrive.id);
200205
}
201206
this.m_firstFrame = false;
202207
}
@@ -205,7 +210,7 @@ public void updateEntity() {
205210
private PacketComputers createDiskLightPacket() {
206211
PacketComputers packet = new PacketComputers();
207212
packet.packetType = 8;
208-
packet.dataInt = new int[]{this.xCoord, this.yCoord, this.zCoord, this.m_clientDiskLight};
213+
packet.dataInt = new int[]{this.x, this.y, this.z, this.m_clientDiskLight};
209214
return packet;
210215
}
211216

@@ -229,7 +234,7 @@ public void handlePacket(PacketComputers packet, EntityPlayer player) {
229234
switch (packet.packetType) {
230235
case 8: {
231236
this.m_clientDiskLight = packet.dataInt[3];
232-
Computers.notifyBlockChange(this.worldObj, this.xCoord, this.yCoord, this.zCoord, Computers.diskDrive.id);
237+
Computers.notifyBlockChange(this.worldObj, this.x, this.y, this.z, Computers.diskDrive.id);
233238
break;
234239
}
235240
}

0 commit comments

Comments
 (0)