Skip to content

Commit

Permalink
Finish 1.8.3 NMS update
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Mar 10, 2015
1 parent 7d0be8a commit a214a3d
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 18 deletions.
Expand Up @@ -226,11 +226,10 @@ boolean preSetup(dLocation loc0) {
// Freeze the first world in the list.
// TODO: make this do all worlds from the locations in the list
CraftWorld craftWorld = (CraftWorld)loc0.getWorld();
// boolean was_static = craftWorld.getHandle().isStatic; // TODO: 1.8.3 update
boolean was_static = craftWorld.getHandle().isClientSide;
if (no_physics)
setWorldIsStatic(loc0.getWorld(), true);
// return was_static; // TODO: 1.8.3 update
return false; // TODO: 1.8.3 update
return was_static;
}

void postComplete(Location loc, boolean was_static) {
Expand All @@ -247,7 +246,7 @@ void setWorldIsStatic(World world, boolean isStatic) {
try {
CraftWorld craftWorld = (CraftWorld) world;
if (isStaticField == null) {
isStaticField = craftWorld.getHandle().getClass().getField("isStatic"); // TODO: 1.8.3 update
isStaticField = craftWorld.getHandle().getClass().getField("isClientSide");
isStaticField.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
Expand Down
Expand Up @@ -171,7 +171,7 @@ private void setDoesSnow(boolean doesSnow) {
dB.echoError(e);
}
try {
rains = BiomeBase.class.getDeclaredField("ay"); // TODO: Are these accurate (1.8.3)?
rains = BiomeBase.class.getDeclaredField("ay");
rains.setAccessible(true);
} catch (Exception e) {
dB.echoError(e);
Expand Down
Expand Up @@ -14,12 +14,11 @@ public enum RabbitType {
KILLER(6,99);

public static RabbitType getRabbitType(Rabbit rabbit) {
// return RabbitType.getType(getEntityRabbit(rabbit).cl()); // TODO: 1.8.3 update
return BROWN; // TODO: 1.8.3 update
return RabbitType.getType(getEntityRabbit(rabbit).getRabbitType());
}

public static void setRabbitType(Rabbit rabbit, RabbitType type) {
// getEntityRabbit(rabbit).r(type.getId()); // TODO: 1.8.3 update
getEntityRabbit(rabbit).setRabbitType(type.getId());
}

private static EntityRabbit getEntityRabbit(Rabbit rabbit) {
Expand Down
Expand Up @@ -14,7 +14,7 @@ public class ActionBar {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutChat.class);
chat_message = fields.get("a"); // TODO: Are these accurate (1.8.3)?
chat_message = fields.get("a");
chat_type = fields.get("b");
}

Expand Down
Expand Up @@ -14,7 +14,7 @@ public class DisplayHeaderFooter {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutPlayerListHeaderFooter.class);
tab_header = fields.get("a"); // TODO: Are these accurate (1.8.3)?
tab_header = fields.get("a");
tab_footer = fields.get("b");
}

Expand Down
Expand Up @@ -14,7 +14,7 @@ public class DisplayTitle {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutTitle.class);
title_action = fields.get("a"); // TODO: Are these accurate (1.8.3)?
title_action = fields.get("a");
chat_component = fields.get("b");
fade_in_ticks = fields.get("c");
stay_ticks = fields.get("d");
Expand Down
Expand Up @@ -23,7 +23,7 @@ public enum EquipmentSlots {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutEntityEquipment.class);
equipment_entityId = fields.get("a"); // TODO: Are these accurate (1.8.3)?
equipment_entityId = fields.get("a");
equipment_slot = fields.get("b");
equipment_itemstack = fields.get("c");
}
Expand Down
Expand Up @@ -24,7 +24,7 @@ public class ItemChangeMessage implements Listener {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutSetSlot.class);
slot_inventoryId = fields.get("a"); // TODO: Are these accurate (1.8.3)?
slot_inventoryId = fields.get("a");
slot_slotId = fields.get("b");
slot_item = fields.get("c");
DenizenAPI.getCurrentInstance().getServer().getPluginManager().registerEvents(new ItemChangeMessage(),
Expand Down
Expand Up @@ -15,7 +15,7 @@ public class OpenBook {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutCustomPayload.class);
channel = fields.get("a"); // TODO: Are these accurate (1.8.3)?
channel = fields.get("a");
packet_data = fields.get("b");
}

Expand Down
Expand Up @@ -16,7 +16,7 @@ public class PlayerBars {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutExperience.class);
xp_current = fields.get("a"); // TODO: Are these accurate (1.8.3)?
xp_current = fields.get("a");
xp_total = fields.get("b");
xp_level = fields.get("c");

Expand Down
Expand Up @@ -14,7 +14,7 @@ public class PlayerSpectateEntity {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutCamera.class);
entity_id = fields.get("a"); // TODO: Are these accurate (1.8.3)?
entity_id = fields.get("a");
}

public static PacketPlayOutCamera getCameraPacket(Entity entity) {
Expand Down
Expand Up @@ -19,7 +19,7 @@ public class SignEditor {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutOpenSignEditor.class);
sign_location = fields.get("a"); // TODO: Are these accurate (1.8.3)?
sign_location = fields.get("a");
}

public static PacketPlayOutOpenSignEditor getSignEditorPacket(Location location) {
Expand Down
Expand Up @@ -18,7 +18,7 @@ public class SignUpdate {

static {
Map<String, Field> fields = PacketHelper.registerFields(PacketPlayOutUpdateSign.class);
sign_world = fields.get("a"); // TODO: Are these accurate (1.8.3)?
sign_world = fields.get("a");
sign_location = fields.get("b");
sign_lines = fields.get("c");
}
Expand Down

0 comments on commit a214a3d

Please sign in to comment.