Revert "Fixed crash on dedicated servers (PacketSpellProperties), Fixes #780, #779, #773, #774, #771, #768"
This reverts commit 6690564017.
This commit is contained in:
@@ -21,13 +21,9 @@ public class PacketSpellProperties implements IMessageHandler<PacketSpellPropert
|
||||
|
||||
net.minecraft.client.Minecraft.getMinecraft().addScheduledTask(() -> {
|
||||
|
||||
int spellId = message.firstId;
|
||||
|
||||
for(int i = 0; i <message.propertiesArray.length; i++){
|
||||
Spell spell = Spell.byNetworkID(spellId);
|
||||
SpellProperties props = message.propertiesArray[i];
|
||||
spell.setPropertiesClient(props);
|
||||
spellId++;
|
||||
int first = message.firstId;
|
||||
for(int i = first; i <message.propertiesArray.length; i++){
|
||||
Spell.byNetworkID(i).setPropertiesClient(message.propertiesArray[i]);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -47,22 +43,16 @@ public class PacketSpellProperties implements IMessageHandler<PacketSpellPropert
|
||||
this.firstId = firstId;
|
||||
this.count = count;
|
||||
this.propertiesArray = properties;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf){
|
||||
List<SpellProperties> propertiesList = new ArrayList<>();
|
||||
firstId = buf.readInt();
|
||||
int i = buf.readInt();
|
||||
count = buf.readInt();
|
||||
|
||||
int k = 0;
|
||||
int j = firstId;
|
||||
while(k < count){
|
||||
SpellProperties props = new SpellProperties(Spell.byNetworkID(j), buf);
|
||||
propertiesList.add(props);
|
||||
k++;
|
||||
j++;
|
||||
firstId = i;
|
||||
while(buf.isReadable() && i < count){
|
||||
propertiesList.add(new SpellProperties(Spell.byNetworkID(i++), buf));
|
||||
}
|
||||
|
||||
propertiesArray = propertiesList.toArray(new SpellProperties[0]);
|
||||
|
||||
Reference in New Issue
Block a user