This commit is contained in:
radmanplays 2024-02-23 12:30:17 +03:30
parent 73f4baa8ef
commit 2fa0bce6ae
119 changed files with 4030 additions and 445 deletions

View File

@ -5,12 +5,113 @@
# Version: 1.0
# Author: lax1dude
> CHANGE 3 : 5 @ 3 : 135
> CHANGE 3 : 8 @ 3 : 135
~
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
~
> CHANGE 354 : 355 @ 354 : 355
> CHANGE 31 : 32 @ 31 : 32
~ public class Block extends ModData {
> INSERT 50 : 51 @ 50
+ protected boolean fullCube = true;
> INSERT 24 : 26 @ 24
+ public boolean noRender = false;
+ public boolean forceRender = false;
> INSERT 1 : 73 @ 1
+ public void loadModData(BaseData data) {
+ unlocalizedName = data.getString("unlocalizedName");
+ slipperiness = data.getFloat("slipperiness");
+ blockParticleGravity = data.getFloat("blockParticleGravity");
+
+ minX = data.getDouble("minX");
+ minY = data.getDouble("minY");
+ minZ = data.getDouble("minY");
+ maxX = data.getDouble("maxX");
+ maxY = data.getDouble("maxY");
+ maxZ = data.getDouble("maxZ");
+
+ enableStats = data.getBoolean("enableStats");
+ needsRandomTick = data.getBoolean("needsRandomTick");
+ isBlockContainer = data.getBoolean("isBlockContainer");
+ useNeighborBrightness = data.getBoolean("useNeighborBrightness");
+ translucent = data.getBoolean("translucent");
+ fullBlock = data.getBoolean("fullBlock");
+
+ lightOpacity = data.getInt("lightOpacity");
+ lightValue = data.getInt("lightValue");
+
+ blockHardness = data.getFloat("blockHardness");
+ blockResistance = data.getFloat("blockResistance");
+
+ noRender = data.getBoolean("noRender");
+ forceRender = data.getBoolean("forceRender");
+ fullCube = data.getBoolean("fullCube");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("unlocalizedName", unlocalizedName);
+ data.set("slipperiness", slipperiness);
+ data.set("blockParticleGravity", blockParticleGravity);
+
+ data.set("minX", minX);
+ data.set("minY", minY);
+ data.set("minZ", minZ);
+ data.set("maxX", maxX);
+ data.set("maxY", maxY);
+ data.set("maxZ", maxZ);
+
+ data.set("blockMaterial", blockMaterial.makeModData());
+
+ data.set("enableStats", enableStats);
+ data.set("needsRandomTick", needsRandomTick);
+ data.set("isBlockContainer", isBlockContainer);
+ data.set("useNeighborBrightness", useNeighborBrightness);
+ data.set("translucent", translucent);
+ data.set("fullBlock", fullBlock);
+ data.set("fullCube", fullCube);
+
+ data.set("lightOpacity", lightOpacity);
+ data.set("lightValue", lightValue);
+ data.set("blockHardness", blockHardness);
+ data.set("blockResistance", blockResistance);
+ data.set("noRender", noRender);
+ data.set("forceRender", forceRender);
+
+ data.setCallbackInt("getID", () -> {
+ return getIdFromBlock(this);
+ });
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ return data;
+ }
+
> CHANGE 132 : 133 @ 132 : 133
~ return this.fullCube && (!this.noRender);
> INSERT 67 : 70 @ 67
+ if (this.noRender || this.forceRender) {
+ return this.forceRender;
+ }
> CHANGE 47 : 48 @ 47 : 48
~ public void randomTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom random) {

View File

@ -0,0 +1,61 @@
# Eagler Context Redacted Diff
# Copyright (c) 2024 lax1dude. All rights reserved.
# Version: 1.0
# Author: lax1dude
> CHANGE 2 : 6 @ 2 : 3
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~
~ public class MapColor extends ModData {
> CHANGE 37 : 39 @ 37 : 39
~ public int colorValue;
~ public int colorIndex;
> INSERT 11 : 49 @ 11
+ public void loadModData(BaseData data) {
+ colorIndex = data.getInt("colorIndex");
+ colorValue = data.getInt("colorValue");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("colorIndex", colorIndex);
+ data.set("colorValue", colorValue);
+
+ int[] rgb = new int[3];
+ int rr;
+ int gg;
+ int bb;
+ int dec = colorValue;
+ rr = (int) Math.floor(dec / 65536);
+ dec -= rr * 65536;
+ gg = (int) Math.floor(dec / 256);
+ dec -= gg * 256;
+ bb = dec;
+ rr = Math.min(rr, 255);
+ rgb[0] = rr;
+ rgb[1] = gg;
+ rgb[2] = bb;
+ data.set("rgb", rgb);
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+
+ return data;
+
+ }
+
> EOF

View File

@ -5,6 +5,135 @@
# Version: 1.0
# Author: lax1dude
> DELETE 2 @ 2 : 8
> CHANGE 2 : 4 @ 2 : 7
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
> CHANGE 1 : 2 @ 1 : 2
~ public class Material extends ModData {
> INSERT 54 : 173 @ 54
+ public static ModData makeModDataStatic() {
+ ModData data = new ModData();
+ data.set("air", air.makeModData());
+ data.set("grass", grass.makeModData());
+ data.set("ground", ground.makeModData());
+ data.set("wood", wood.makeModData());
+ data.set("rock", rock.makeModData());
+ data.set("iron", iron.makeModData());
+ data.set("anvil", anvil.makeModData());
+ data.set("water", water.makeModData());
+ data.set("lava", lava.makeModData());
+ data.set("leaves", leaves.makeModData());
+ data.set("plants", plants.makeModData());
+ data.set("vine", vine.makeModData());
+ data.set("sponge", sponge.makeModData());
+ data.set("cloth", cloth.makeModData());
+ data.set("fire", fire.makeModData());
+ data.set("sand", sand.makeModData());
+ data.set("circuits", circuits.makeModData());
+ data.set("carpet", carpet.makeModData());
+ data.set("glass", glass.makeModData());
+ data.set("redstoneLight", redstoneLight.makeModData());
+ data.set("tnt", tnt.makeModData());
+ data.set("coral", coral.makeModData());
+ data.set("ice", ice.makeModData());
+ data.set("packedIce", packedIce.makeModData());
+ data.set("snow", snow.makeModData());
+ data.set("craftedSnow", craftedSnow.makeModData());
+ data.set("cactus", cactus.makeModData());
+ data.set("clay", clay.makeModData());
+ data.set("gourd", gourd.makeModData());
+ data.set("dragonEgg", dragonEgg.makeModData());
+ data.set("portal", portal.makeModData());
+ data.set("cake", cake.makeModData());
+ data.set("web", web.makeModData());
+ data.set("piston", piston.makeModData());
+ data.set("barrier", barrier.makeModData());
+ return data;
+ }
+
+ public void loadModData(BaseData data) {
+ canBurn = data.getBoolean("canBurn");
+ replaceable = data.getBoolean("replaceable");
+ requiresNoTool = data.getBoolean("requiresNoTool");
+ isTranslucent = data.getBoolean("isTranslucent");
+ isAdventureModeExempt = data.getBoolean("isAdventureModeExempt");
+ materialMapColor.loadModData(data.getBaseData("materialMapColor"));
+
+ mobilityFlag = data.getInt("mobilityFlag");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.set("canBurn", canBurn);
+ data.set("replaceable", replaceable);
+ data.set("isTranslucent", isTranslucent);
+ data.set("requiresNoTool", requiresNoTool);
+ data.set("mobilityFlag", mobilityFlag);
+ data.set("isAdventureModeExempt", isAdventureModeExempt);
+ data.set("materialMapColor", materialMapColor.makeModData());
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+
+ data.setCallbackBoolean("isLiquid", () -> {
+ return isLiquid();
+ });
+ data.setCallbackBoolean("isSolid", () -> {
+ return isSolid();
+ });
+ data.setCallbackBoolean("isReplaceable", () -> {
+ return isReplaceable();
+ });
+ data.setCallbackBoolean("isToolNotRequired", () -> {
+ return isToolNotRequired();
+ });
+ data.setCallbackBoolean("isOpaque", () -> {
+ return isOpaque();
+ });
+ data.setCallbackBoolean("getCanBurn", () -> {
+ return getCanBurn();
+ });
+ data.setCallbackBoolean("blocksLight", () -> {
+ return blocksLight();
+ });
+ data.setCallbackBoolean("blocksMovement", () -> {
+ return blocksMovement();
+ });
+ data.setCallbackObject("setTranslucent", () -> {
+ return setTranslucent().makeModData();
+ });
+ data.setCallbackObject("setRequiresTool", () -> {
+ return setRequiresTool().makeModData();
+ });
+ data.setCallbackObject("setBurning", () -> {
+ return setBurning().makeModData();
+ });
+ data.setCallbackObject("setReplaceable", () -> {
+ return setReplaceable().makeModData();
+ });
+ data.setCallbackObject("setNoPushMobility", () -> {
+ return setNoPushMobility().makeModData();
+ });
+ data.setCallbackInt("getMaterialMobility", () -> {
+ return getMaterialMobility();
+ });
+ data.setCallbackObject("setImmovableMobility", () -> {
+ return setImmovableMobility().makeModData();
+ });
+ data.setCallbackObject("setAdventureModeExempt", () -> {
+ return setAdventureModeExempt().makeModData();
+ });
+ return data;
+ }
+
> EOF

View File

@ -134,11 +134,12 @@
~ public class Minecraft extends ModData implements IThreadListener {
> CHANGE 2 : 3 @ 2 : 9
> CHANGE 2 : 4 @ 2 : 10
~ public static final boolean isRunningOnMac = false;
~ public ServerData currentServerData;
> DELETE 12 @ 12 : 14
> DELETE 11 @ 11 : 13
> INSERT 11 : 12 @ 11

View File

@ -5,10 +5,61 @@
# Version: 1.0
# Author: lax1dude
> CHANGE 2 : 3 @ 2 : 3
> CHANGE 2 : 5 @ 2 : 3
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
> DELETE 1 @ 1 : 2
> INSERT 1 : 3 @ 1
+ import net.minecraft.nbt.JsonToNBT;
+ import net.minecraft.nbt.NBTTagCompound;
> INSERT 23 : 64 @ 23
+ @Override
+ public ModData makeModData() {
+ ModData data = super.makeModData();
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.set("otherPlayerMPPosRotationIncrements", otherPlayerMPPosRotationIncrements);
+ data.set("otherPlayerMPX", otherPlayerMPX);
+ data.set("otherPlayerMPY", otherPlayerMPY);
+ data.set("otherPlayerMPZ", otherPlayerMPZ);
+ data.set("otherPlayerMPYaw", otherPlayerMPYaw);
+ data.set("otherPlayerMPPitch", otherPlayerMPPitch);
+ data.setCallbackVoidWithDataArg("setCurrentItemOrArmor", (BaseData params) -> {
+ try {
+ NBTTagCompound nbtParsed = JsonToNBT.getTagFromJson(params.getString("itemNbt"));
+ ItemStack stack = ItemStack.loadItemStackFromNBT(nbtParsed);
+ setCurrentItemOrArmor(params.getInt("slotIn"), stack);
+ } catch (Exception e) {
+ }
+ });
+ data.setCallbackBoolean("isSpectator", () -> {
+ return isSpectator();
+ });
+
+ return data;
+ }
+
+ @Override
+ public void loadModData(BaseData data) {
+ super.loadModData(data);
+ otherPlayerMPPosRotationIncrements = data.getInt("otherPlayerMPPosRotationIncrements");
+ otherPlayerMPX = data.getDouble("otherPlayerMPX");
+ otherPlayerMPY = data.getDouble("otherPlayerMPX");
+ otherPlayerMPZ = data.getDouble("otherPlayerMPX");
+ otherPlayerMPYaw = data.getDouble("otherPlayerMPX");
+ otherPlayerMPPitch = data.getDouble("otherPlayerMPX");
+ }
+
> EOF

View File

@ -5,8 +5,11 @@
# Version: 1.0
# Author: lax1dude
> INSERT 2 : 6 @ 2
> INSERT 2 : 9 @ 2
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModAPI;
+ import net.eaglerforge.api.ModData;
+ import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
+ import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager;
+ import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
@ -30,13 +33,188 @@
+ this.statWriter = statWriter;
> CHANGE 116 : 123 @ 116 : 117
> INSERT 2 : 141 @ 2
+ @Override
+ public ModData makeModData() {
+ ModData data = super.makeModData();
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.set("lastReportedPosX", lastReportedPosX);
+ data.set("lastReportedPosY", lastReportedPosY);
+ data.set("lastReportedPosZ", lastReportedPosZ);
+ data.set("lastReportedYaw", lastReportedYaw);
+ data.set("lastReportedPitch", lastReportedPitch);
+ data.set("serverSneakState", serverSneakState);
+ data.set("serverSprintState", serverSprintState);
+ data.set("positionUpdateTicks", positionUpdateTicks);
+ data.set("hasValidHealth", hasValidHealth);
+ data.set("clientBrand", clientBrand);
+ data.set("sprintToggleTimer", sprintToggleTimer);
+ data.set("sprintingTicksLeft", sprintingTicksLeft);
+
+ data.set("renderArmYaw", renderArmYaw);
+ data.set("renderArmPitch", renderArmPitch);
+ data.set("prevRenderArmYaw", prevRenderArmYaw);
+ data.set("prevRenderArmPitch", prevRenderArmPitch);
+ data.set("horseJumpPower", horseJumpPower);
+ data.set("horseJumpPowerCounter", horseJumpPowerCounter);
+
+ data.setCallbackVoidWithDataArg("mountEntity", (BaseData params) -> {
+ if (params.getBaseData("entityIn") instanceof Entity) {
+ mountEntity((Entity) params.getBaseData("entityIn"));
+ }
+ });
+ data.setCallbackObjectWithDataArg("dropOneItem", (BaseData params) -> {
+ EntityItem itemEntity = dropOneItem(params.getBoolean("dropAll"));
+ if (itemEntity != null) {
+ return itemEntity.makeModData();
+ } else {
+ return null;
+ }
+ });
+ data.setCallbackVoidWithDataArg("sendChatMessage", (BaseData params) -> {
+ sendChatMessage(params.getString("message"));
+ });
+ data.setCallbackVoid("respawnPlayer", () -> {
+ respawnPlayer();
+ });
+ data.setCallbackVoid("closeScreen", () -> {
+ closeScreen();
+ });
+ data.setCallbackVoid("closeScreenAndDropStack", () -> {
+ closeScreenAndDropStack();
+ });
+ data.setCallbackVoidWithDataArg("setPlayerSPHealth", (BaseData params) -> {
+ setPlayerSPHealth(params.getFloat("health"));
+ });
+ data.setCallbackVoid("sendPlayerAbilities", () -> {
+ sendPlayerAbilities();
+ });
+ data.setCallbackBoolean("isUser", () -> {
+ /**
+ * + returns true if this is an EntityPlayerSP, or the logged in player.
+ */
+ return isUser();
+ });
+ data.setCallbackVoid("sendHorseInventory", () -> {
+ sendHorseInventory();
+ });
+ data.setCallbackVoid("sendHorseJump", () -> {
+ sendHorseJump();
+ });
+ data.setCallbackVoidWithDataArg("setClientBrand", (BaseData params) -> {
+ setClientBrand(params.getString("brand"));
+ });
+ data.setCallbackString("getClientBrand", () -> {
+ return getClientBrand();
+ });
+ data.setCallbackBooleanWithDataArg("pushOutOfBlocks", (BaseData params) -> {
+ return pushOutOfBlocks(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"));
+ });
+ data.setCallbackBooleanWithDataArg("isOpenBlockSpace", (BaseData bp) -> {
+ /**
+ * + Returns true if the block at the given BlockPos and the block above it are
+ * NOT full cubes.
+ */
+ return isOpenBlockSpace(BlockPos.fromModData(bp));
+ });
+ data.setCallbackVoidWithDataArg("setXPStats", (BaseData params) -> {
+ setXPStats(params.getFloat("currentXP"), params.getInt("maxXP"), params.getInt("level"));
+ });
+ data.setCallbackVoidWithDataArg("playSound", (BaseData params) -> {
+ playSound(params.getString("name"), params.getFloat("volume"), params.getFloat("pitch"));
+ });
+ data.setCallbackBoolean("isServerWorld", () -> {
+ /**
+ * + Returns whether the entity is in a server world
+ */
+ return isServerWorld();
+ });
+ data.setCallbackBoolean("isRidingHorse", () -> {
+ return isRidingHorse();
+ });
+ data.setCallbackFloat("getHorseJumpPower", () -> {
+ return getHorseJumpPower();
+ });
+ data.setCallbackBoolean("isCurrentViewEntity", () -> {
+ return isCurrentViewEntity();
+ });
+ data.setCallbackBoolean("isSpectator", () -> {
+ return isSpectator();
+ });
+ return data;
+ }
+
+ @Override
+ public void loadModData(BaseData data) {
+ super.loadModData(data);
+ lastReportedPosX = data.getDouble("lastReportedPosX");
+ lastReportedPosY = data.getDouble("lastReportedPosY");
+ lastReportedPosZ = data.getDouble("lastReportedPosZ");
+ lastReportedYaw = data.getFloat("lastReportedYaw");
+ lastReportedPitch = data.getFloat("lastReportedPitch");
+ serverSneakState = data.getBoolean("serverSneakState");
+ serverSprintState = data.getBoolean("serverSprintState");
+ positionUpdateTicks = data.getInt("positionUpdateTicks");
+ hasValidHealth = data.getBoolean("hasValidHealth");
+ clientBrand = data.getString("clientBrand");
+ sprintToggleTimer = data.getInt("sprintToggleTimer");
+ sprintingTicksLeft = data.getInt("sprintingTicksLeft");
+
+ renderArmYaw = data.getFloat("renderArmYaw");
+ renderArmPitch = data.getFloat("renderArmPitch");
+ prevRenderArmYaw = data.getFloat("prevRenderArmYaw");
+ prevRenderArmPitch = data.getFloat("prevRenderArmPitch");
+ horseJumpPower = data.getFloat("horseJumpPower");
+ horseJumpPowerCounter = data.getInt("horseJumpPowerCounter");
+ }
+
> INSERT 17 : 18 @ 17
+ mc.modapi.onUpdate();
> INSERT 8 : 9 @ 8
+ ModAPI.callEvent("postmotionupdate", new ModData());
> INSERT 6 : 11 @ 6
+ ModData event = new ModData();
+ event.set("yaw", this.rotationYaw);
+ event.set("pitch", this.rotationPitch);
+ event.set("onground", this.onGround);
+ ModAPI.callEvent("premotionupdate", event);
> CHANGE 34 : 40 @ 34 : 35
~ ModData eventData = new ModData();
~ eventData.set("preventDefault", false);
~ BaseData newEvent = ModAPI.callEvent("motionupdate", eventData);
~ if (newEvent.has("preventDefault") && newEvent.getBoolean("preventDefault") == true) {
~ // *sneeze*
~ } else if (this.ridingEntity == null) {
> CHANGE 48 : 63 @ 48 : 49
~ if (((sendQueue.getNetworkManager() instanceof ClientIntegratedServerNetworkManager)
~ || (sendQueue.getNetworkManager() instanceof LANClientNetworkManager))
~ && message.startsWith("/eagskull")) {
~ this.mc.eagskullCommand.openFileChooser();
~ } else {
~ ModData event = new ModData();
~ event.set("message", message);
~ event.set("preventDefault", false);
~ BaseData newEvent = mc.modapi.callEvent("sendchatmessage", event);
~ if (newEvent.has("preventDefault") && newEvent.getBoolean("preventDefault")) {
~ return;
~ }
~ message = newEvent.has("message") ? newEvent.getString("message") : message;
~ this.sendQueue.addToSendQueue(new C01PacketChatMessage(message));
~ }

View File

@ -15,9 +15,11 @@
> DELETE 1 @ 1 : 3
> INSERT 3 : 25 @ 3
> INSERT 3 : 27 @ 3
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
+ import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
+ import net.minecraft.nbt.CompressedStreamTools;
+ import net.minecraft.nbt.NBTTagCompound;
@ -44,7 +46,11 @@
> DELETE 5 @ 5 : 11
> DELETE 3 @ 3 : 8
> CHANGE 1 : 2 @ 1 : 2
~ public class GameSettings extends ModData {
> DELETE 1 @ 1 : 6
> DELETE 1 @ 1 : 9
@ -129,7 +135,170 @@
~ this.renderDistanceChunks = 4;
> DELETE 3 @ 3 : 18
> CHANGE 3 : 75 @ 3 : 16
~ public void loadModData(BaseData data) {
~ mouseSensitivity = data.getFloat("mouseSensitivity");
~ invertMouse = data.getBoolean("invertMouse");
~ renderDistanceChunks = data.getInt("renderDistanceChunks");
~ viewBobbing = data.getBoolean("viewBobbing");
~ anaglyph = data.getBoolean("anaglyph");
~ fboEnable = data.getBoolean("fboEnable");
~ limitFramerate = data.getInt("limitFramerate");
~ clouds = data.getInt("clouds");
~
~ fancyGraphics = data.getBoolean("fancyGraphics");
~ ambientOcclusion = data.getInt("ambientOcclusion");
~ chatVisibility = EntityPlayer.EnumChatVisibility.valueOf(data.getString("chatVisibility"));
~ chatColours = data.getBoolean("chatColours");
~ chatLinks = data.getBoolean("chatLinks");
~ chatLinksPrompt = data.getBoolean("chatLinksPrompt");
~ chatOpacity = data.getFloat("chatOpacity");
~ enableVsync = data.getBoolean("enableVsync");
~ snooperEnabled = data.getBoolean("snooperEnabled");
~
~ allowBlockAlternatives = data.getBoolean("allowBlockAlternatives");
~ reducedDebugInfo = data.getBoolean("reducedDebugInfo");
~ hideServerAddress = data.getBoolean("hideServerAddress");
~ pauseOnLostFocus = data.getBoolean("pauseOnLostFocus");
~ touchscreen = data.getBoolean("touchscreen");
~ overrideWidth = data.getInt("overrideWidth");
~ overrideHeight = data.getInt("overrideHeight");
~ heldItemTooltips = data.getBoolean("heldItemTooltips");
~ chatScale = data.getFloat("chatScale");
~ chatWidth = data.getFloat("chatWidth");
~
~ chatHeightUnfocused = data.getFloat("chatHeightUnfocused");
~ chatHeightFocused = data.getFloat("chatHeightFocused");
~ fovSetting = data.getFloat("fovSetting");
~ gammaSetting = data.getFloat("gammaSetting");
~ saturation = data.getFloat("saturation");
~
~ guiScale = data.getInt("guiScale");
~ fxaa = data.getInt("fxaa");
~ particleSetting = data.getInt("particleSetting");
~
~ thirdPersonView = data.getInt("thirdPersonView");
~ mipmapLevels = data.getInt("mipmapLevels");
~
~ forceUnicodeFont = data.getBoolean("forceUnicodeFont");
~ hudFps = data.getBoolean("hudFps");
~ hudCoords = data.getBoolean("hudCoords");
~ hudPlayer = data.getBoolean("hudPlayer");
~ hudWorld = data.getBoolean("hudWorld");
~ hudStats = data.getBoolean("hudStats");
~ hud24h = data.getBoolean("hud24h");
~ chunkFix = data.getBoolean("chunkFix");
~ fog = data.getBoolean("fog");
~
~ hideGUI = data.getBoolean("hideGUI");
~ smoothCamera = data.getBoolean("smoothCamera");
~ debugCamEnable = data.getBoolean("debugCamEnable");
~ showDebugInfo = data.getBoolean("showDebugInfo");
~ showDebugProfilerChart = data.getBoolean("showDebugProfilerChart");
~ showInventoryAchievementHint = data.getBoolean("showInventoryAchievementHint");
~
~ difficulty = EnumDifficulty.valueOf(data.getString("difficulty"));
~
~ lastServer = data.getString("lastServer");
~ language = data.getString("language");
~
~ BaseData[] parBaseDatas = data.getBaseDataArr("keyBindings");
~ for (int i = 0; i < keyBindings.length; i++) {
~ if (keyBindings[i] != null && parBaseDatas[i] != null) {
~ keyBindings[i].loadModData(parBaseDatas[i]);
~ }
~ }
> INSERT 2 : 89 @ 2
+ public ModData makeModData() {
+ ModData data = new ModData();
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+
+ ModData[] parModDatas = new ModData[keyBindings.length];
+ for (int i = 0; i < keyBindings.length; i++) {
+ if (keyBindings[i] != null) {
+ parModDatas[i] = keyBindings[i].makeModData();
+ }
+ }
+
+ data.set("keyBindings", parModDatas);
+
+ data.set("mouseSensitivity", mouseSensitivity);
+ data.set("invertMouse", invertMouse);
+ data.set("renderDistanceChunks", renderDistanceChunks);
+ data.set("viewBobbing", viewBobbing);
+ data.set("anaglyph", anaglyph);
+ data.set("fboEnable", fboEnable);
+ data.set("limitFramerate", limitFramerate);
+ data.set("clouds", clouds);
+
+ data.set("fancyGraphics", fancyGraphics);
+ data.set("ambientOcclusion", ambientOcclusion);
+ data.set("chatVisibility", chatVisibility.name());
+ data.set("chatColours", chatColours);
+ data.set("chatLinks", chatLinks);
+ data.set("chatLinksPrompt", chatLinksPrompt);
+ data.set("chatOpacity", chatOpacity);
+ data.set("snooperEnabled", snooperEnabled);
+ data.set("enableVsync", enableVsync);
+
+ data.set("allowBlockAlternatives", allowBlockAlternatives);
+ data.set("reducedDebugInfo", reducedDebugInfo);
+ data.set("hideServerAddress", hideServerAddress);
+ data.set("advancedItemTooltips", advancedItemTooltips);
+ data.set("pauseOnLostFocus", pauseOnLostFocus);
+ data.set("touchscreen", touchscreen);
+ data.set("overrideWidth", overrideWidth);
+ data.set("overrideHeight", overrideHeight);
+ data.set("heldItemTooltips", heldItemTooltips);
+ data.set("chatScale", chatScale);
+ data.set("chatWidth", chatWidth);
+
+ data.set("chatHeightUnfocused", chatHeightUnfocused);
+ data.set("chatHeightFocused", chatHeightFocused);
+ data.set("fovSetting", fovSetting);
+ data.set("gammaSetting", gammaSetting);
+ data.set("saturation", saturation);
+
+ data.set("guiScale", guiScale);
+ data.set("fxaa", fxaa);
+ data.set("particleSetting", particleSetting);
+ data.set("thirdPersonView", thirdPersonView);
+ data.set("mipmapLevels", mipmapLevels);
+
+ data.set("forceUnicodeFont", forceUnicodeFont);
+ data.set("hudFps", hudFps);
+ data.set("hudCoords", hudCoords);
+ data.set("hudPlayer", hudPlayer);
+ data.set("hudWorld", hudWorld);
+ data.set("hudStats", hudStats);
+ data.set("hud24h", hud24h);
+ data.set("chunkFix", chunkFix);
+ data.set("fog", fog);
+ data.set("hideGUI", hideGUI);
+ data.set("smoothCamera", smoothCamera);
+ data.set("debugCamEnable", debugCamEnable);
+ data.set("showDebugInfo", showDebugInfo);
+ data.set("showDebugProfilerChart", showDebugProfilerChart);
+ data.set("showInventoryAchievementHint", showInventoryAchievementHint);
+
+ data.set("difficulty", difficulty.name());
+
+ data.set("lastServer", lastServer);
+ data.set("language", language);
+
+ return data;
+ }
+
> CHANGE 3 : 4 @ 3 : 4

View File

@ -7,11 +7,75 @@
> DELETE 2 @ 2 : 4
> INSERT 2 : 6 @ 2
> INSERT 2 : 8 @ 2
+
+ import com.google.common.collect.Lists;
+ import com.google.common.collect.Sets;
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
> CHANGE 3 : 4 @ 3 : 4
~ public class KeyBinding extends ModData implements Comparable<KeyBinding> {
> INSERT 60 : 115 @ 60
+ public void loadModData(BaseData data) {
+ keyCode = data.getInt("keyCode");
+ pressed = data.getBoolean("pressed");
+ pressTime = data.getInt("pressTime");
+
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+
+ data.set("keyCode", keyCode);
+ data.set("pressed", pressed);
+ data.set("pressTime", pressTime);
+ data.set("keyDescription", keyDescription);
+ data.set("keyCategory", keyCategory);
+
+ data.setCallbackBoolean("isKeyDown", () -> {
+ return isKeyDown();
+ });
+
+ data.setCallbackString("getKeyCategory", () -> {
+ return getKeyCategory();
+ });
+
+ data.setCallbackBoolean("isPressed", () -> {
+ return isPressed();
+ });
+
+ data.setCallbackVoid("unpressKey", () -> {
+ unpressKey();
+ });
+
+ data.setCallbackString("getKeyDescription", () -> {
+ return getKeyDescription();
+ });
+
+ data.setCallbackInt("getKeyCodeDefault", () -> {
+ return getKeyCodeDefault();
+ });
+
+ data.setCallbackInt("getKeyCode", () -> {
+ return getKeyCode();
+ });
+
+ return data;
+ }
+
> EOF

View File

@ -7,11 +7,54 @@
> DELETE 2 @ 2 : 4
> CHANGE 3 : 7 @ 3 : 21
> CHANGE 3 : 9 @ 3 : 21
~
~ import com.google.common.collect.Lists;
~ import com.google.common.collect.Maps;
~
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
> CHANGE 8 : 9 @ 8 : 9
~ public abstract class Enchantment extends ModData {
> CHANGE 41 : 42 @ 41 : 42
~ private int weight;
> INSERT 19 : 49 @ 19
+ public void loadModData(BaseData data) {
+ weight = data.getInt("weight");
+ name = data.getString("name");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("enchID", effectId);
+ data.set("weight", weight);
+ data.set("name", name);
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ return data;
+ }
+
+ public static ModData makeModDataStatic() {
+ ModData data = new ModData();
+ Map<ResourceLocation, Enchantment> enchMap = locationEnchantments;
+ for (Map.Entry<ResourceLocation, Enchantment> entry : enchMap.entrySet()) {
+ if (entry.getKey().resourceName != null && entry.getValue() != null) {
+ data.set(entry.getKey().resourceName, entry.getValue().makeModData());
+ }
+ }
+ return data;
+ }
+
> EOF

View File

@ -5,8 +5,11 @@
# Version: 1.0
# Author: lax1dude
> CHANGE 3 : 8 @ 3 : 5
> CHANGE 3 : 11 @ 3 : 5
~
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
~ import net.lax1dude.eaglercraft.v1_8.HString;
@ -23,7 +26,15 @@
> DELETE 6 @ 6 : 9
> CHANGE 74 : 75 @ 74 : 75
> CHANGE 8 : 9 @ 8 : 12
~ import net.minecraft.nbt.*;
> CHANGE 17 : 18 @ 17 : 18
~ public abstract class Entity extends ModData implements ICommandSender {
> CHANGE 44 : 45 @ 44 : 45
~ protected EaglercraftRandom rand;
@ -75,7 +86,380 @@
~ for (AxisAlignedBB axisalignedbb12 : (List<AxisAlignedBB>) list) {
> CHANGE 651 : 653 @ 651 : 652
> INSERT 233 : 603 @ 233
+ public void loadModData(BaseData data) {
+ posX = data.getDouble("x");
+ posY = data.getDouble("y");
+ posZ = data.getDouble("z");
+ motionX = data.getDouble("motionX");
+ motionY = data.getDouble("motionY");
+ motionZ = data.getDouble("motionZ");
+ rotationYaw = data.getFloat("yaw");
+ rotationPitch = data.getFloat("pitch");
+ isInWeb = data.getBoolean("isInWeb");
+ onGround = data.getBoolean("onGround");
+ noClip = data.getBoolean("noClip");
+ stepHeight = data.getFloat("stepHeight");
+ isCollided = data.getBoolean("isCollided");
+ isCollidedHorizontally = data.getBoolean("isCollidedHorizontally");
+ isCollidedVertically = data.getBoolean("isCollidedVertically");
+ inPortal = data.getBoolean("inPortal");
+ inWater = data.getBoolean("inWater");
+ isAirBorne = data.getBoolean("isAirBorne");
+ invulnerable = data.getBoolean("invulnerable");
+ isImmuneToFire = data.getBoolean("isImmuneToFire");
+ isOutsideBorder = data.getBoolean("isOutsideBorder");
+ entityCollisionReduction = data.getFloat("entityCollisionReduction");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("x", posX);
+ data.set("y", posY);
+ data.set("z", posZ);
+ data.set("chunkCoordX", chunkCoordX);
+ data.set("chunkCoordY", chunkCoordY);
+ data.set("chunkCoordZ", chunkCoordZ);
+ data.set("motionX", motionX);
+ data.set("motionY", motionY);
+ data.set("motionZ", motionZ);
+ data.set("yaw", rotationYaw);
+ data.set("pitch", rotationPitch);
+ data.set("isInWeb", isInWeb);
+ data.set("isCollided", isCollided);
+ data.set("isCollidedVertically", isCollidedVertically);
+ data.set("isCollidedHorizontally", isCollidedHorizontally);
+ data.set("onGround", onGround);
+ data.set("dimension", dimension);
+ data.set("id", entityId);
+ data.set("fallDistance", fallDistance);
+ data.set("noClip", noClip);
+ data.set("stepHeight", stepHeight);
+ data.set("isDead", isDead);
+ data.set("inPortal", inPortal);
+ data.set("inWater", inWater);
+ data.set("isAirBorne", isAirBorne);
+ data.set("ticksExisted", ticksExisted);
+ data.set("invulnerable", invulnerable);
+ data.set("isImmuneToFire", isImmuneToFire);
+ data.set("isOutsideBorder", isOutsideBorder);
+ data.set("entityCollisionReduction", entityCollisionReduction);
+ data.set("ticksExisted", ticksExisted);
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+
+ data.setCallbackBoolean("isBurning", () -> {
+ /**
+ * + Returns true if the entity is on fire. Used by render to add the fire
+ * effect on rendering.
+ */
+ return isBurning();
+ });
+ data.setCallbackBoolean("isPushedByWater", () -> {
+ return isPushedByWater();
+ });
+ data.setCallbackBoolean("isEating", () -> {
+ return isEating();
+ });
+ data.setCallbackBoolean("isEntityAlive", () -> {
+ /**
+ * + Checks whether target entity is alive.
+ */
+ return isEntityAlive();
+ });
+ data.setCallbackBoolean("isEntityInsideOpaqueBlock", () -> {
+ /**
+ * + Checks if this entity is inside of an opaque block
+ */
+ return isEntityInsideOpaqueBlock();
+ });
+ data.setCallbackBoolean("isImmuneToExplosions", () -> {
+ return isImmuneToExplosions();
+ });
+ data.setCallbackBoolean("isImmuneToFire", () -> {
+ return isImmuneToFire();
+ });
+ data.setCallbackBoolean("isInLava", () -> {
+ return isInLava();
+ });
+ data.setCallbackBooleanWithDataArg("isInRangeToRender3d", (BaseData params) -> {
+ return isInRangeToRender3d(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"));
+ });
+ data.setCallbackBooleanWithDataArg("isInRangeToRenderDist", (BaseData params) -> {
+ /**
+ * + Checks if the entity is in range to render by using the past in distance
+ * and comparing it to its average edge length * 64 * renderDistanceWeight Args:
+ * distance
+ */
+ return isInRangeToRenderDist(params.getDouble("distance"));
+ });
+ data.setCallbackBoolean("isInWater", () -> {
+ /**
+ * + Checks if this entity is inside water (if inWater field is true as a result
+ * of handleWaterMovement() returning true)
+ */
+ return isInWater();
+ });
+ data.setCallbackBoolean("isInvisible", () -> {
+ return isInvisible();
+ });
+ data.setCallbackBoolean("isPushedByWater", () -> {
+ return isPushedByWater();
+ });
+ data.setCallbackBoolean("isRiding", () -> {
+ /**
+ * + Returns true if the entity is riding another entity, used by render to
+ * rotate the legs to be in 'sit' position for players.
+ */
+ return isRiding();
+ });
+ data.setCallbackBoolean("isSilent", () -> {
+ /**
+ * +
+ *
+ * @return True if this entity will not play sounds
+ */
+ return isSilent();
+ });
+ data.setCallbackBoolean("isSneaking", () -> {
+ /**
+ * + Returns if this entity is sneaking.
+ */
+ return isSneaking();
+ });
+ data.setCallbackBoolean("isSprinting", () -> {
+ /**
+ * + Get if the Entity is sprinting.
+ */
+ return isSprinting();
+ });
+ data.setCallbackBoolean("isWet", () -> {
+ /**
+ * + Checks if this entity is either in water or on an open air block in rain
+ * (used in wolves).
+ */
+ return isWet();
+ });
+
+ data.setCallbackVoidWithDataArg("setAir", (BaseData params) -> {
+ setAir(params.getInt("air"));
+ });
+ data.setCallbackVoidWithDataArg("setAlwaysRenderNameTag", (BaseData params) -> {
+ setAlwaysRenderNameTag(params.getBoolean("alwaysRenderNameTag"));
+ });
+ data.setCallbackVoidWithDataArg("setAngles", (BaseData params) -> {
+ setAngles(params.getFloat("yaw"), params.getFloat("pitch"));
+ });
+ data.setCallbackVoid("setBeenAttacked", () -> {
+ setBeenAttacked();
+ });
+ data.setCallbackVoidWithDataArg("setCustomNameTag", (BaseData params) -> {
+ setCustomNameTag(params.getString("name"));
+ });
+ data.setCallbackVoid("setDead", () -> {
+ setDead();
+ });
+ data.setCallbackVoidWithDataArg("setEating", (BaseData params) -> {
+ setEating(params.getBoolean("eating"));
+ });
+ data.setCallbackVoidWithDataArg("setEntityId", (BaseData params) -> {
+ setEntityId(params.getInt("id"));
+ });
+ data.setCallbackVoidWithDataArg("setFire", (BaseData params) -> {
+ setFire(params.getInt("seconds"));
+ });
+ data.setCallbackVoidWithDataArg("setFlag", (BaseData params) -> {
+ setFlag(params.getInt("flag"), params.getBoolean("set"));
+ });
+ data.setCallbackVoid("setInWeb", () -> {
+ setInWeb();
+ });
+ data.setCallbackVoidWithDataArg("setInvisible", (BaseData params) -> {
+ setInvisible(params.getBoolean("invisible"));
+ });
+ data.setCallbackVoidWithDataArg("setLocationAndAngles", (BaseData params) -> {
+ setLocationAndAngles(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"),
+ params.getFloat("yaw"), params.getFloat("pitch"));
+ });
+ data.setCallbackVoid("setOnFireFromLava", () -> {
+ setOnFireFromLava();
+ });
+ data.setCallbackVoidWithDataArg("setOutsideBorder", (BaseData params) -> {
+ setOutsideBorder(params.getBoolean("outsideBorder"));
+ });
+ data.setCallbackVoidWithDataArg("setPosition", (BaseData params) -> {
+ setPosition(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"));
+ });
+ data.setCallbackVoidWithDataArg("setPositionAndRotation", (BaseData params) -> {
+ setPositionAndRotation(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"),
+ params.getFloat("yaw"), params.getFloat("pitch"));
+ });
+ data.setCallbackVoidWithDataArg("setPositionAndRotation2", (BaseData params) -> {
+ setPositionAndRotation2(params.getDouble("d0"), params.getDouble("d1"), params.getDouble("d2"),
+ params.getFloat("f"), params.getFloat("f1"), params.getInt("var9"), params.getBoolean("var10"));
+ });
+ data.setCallbackVoidWithDataArg("setPositionAndUpdate", (BaseData params) -> {
+ setPositionAndUpdate(params.getDouble("d0"), params.getDouble("d1"), params.getDouble("d2"));
+ });
+ data.setCallbackVoidWithDataArg("setRotation", (BaseData params) -> {
+ setRotation(params.getFloat("yaw"), params.getFloat("pitch"));
+ });
+ data.setCallbackVoidWithDataArg("setRotationYawHead", (BaseData params) -> {
+ setRotationYawHead(params.getFloat("rotation"));
+ });
+ data.setCallbackVoidWithDataArg("setSilent", (BaseData params) -> {
+ setSilent(params.getBoolean("isSilent"));
+ });
+ data.setCallbackVoidWithDataArg("setSize", (BaseData params) -> {
+ setSize(params.getFloat("f"), params.getFloat("f1"));
+ });
+ data.setCallbackVoidWithDataArg("setSneaking", (BaseData params) -> {
+ setSneaking(params.getBoolean("sneaking"));
+ });
+ data.setCallbackVoidWithDataArg("setSprinting", (BaseData params) -> {
+ setSprinting(params.getBoolean("flag"));
+ });
+ data.setCallbackVoidWithDataArg("setVelocity", (BaseData params) -> {
+ setVelocity(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"));
+ });
+
+ // Todo: add other getters and other functions. When I get told to! hahhahahah
+ data.setCallbackString("getUUID", () -> {
+ return entityUniqueID.toString();
+ });
+
+ data.setCallbackInt("getAir", () -> {
+ return getAir();
+ });
+ data.setCallbackBoolean("getAlwaysRenderNameTag", () -> {
+ return getAlwaysRenderNameTag();
+ });
+ data.setCallbackBoolean("getAlwaysRenderNameTagForRender", () -> {
+ return getAlwaysRenderNameTagForRender();
+ });
+ data.setCallbackFloatWithDataArg("getBrightness", (BaseData params) -> {
+ return getBrightness(params.getFloat("var1"));
+ });
+ data.setCallbackIntWithDataArg("getBrightnessForRender", (BaseData params) -> {
+ return getBrightnessForRender(params.getFloat("var1"));
+ });
+ data.setCallbackFloat("getCollisionBorderSize", () -> {
+ return getCollisionBorderSize();
+ });
+ data.setCallbackObject("getCollisionBoundingBox", () -> {
+ return getCollisionBoundingBox().makeModData();
+ });
+ data.setCallbackObject("getCommandSenderEntity", () -> {
+ return getCommandSenderEntity().makeModData();
+ });
+ data.setCallbackString("getCustomNameTag", () -> {
+ return getCustomNameTag();
+ });
+ data.setCallbackString("getDisplayName", () -> {
+ return getDisplayName().getUnformattedText();
+ });
+ data.setCallbackString("getDisplayNameFormatted", () -> {
+ return getDisplayName().getFormattedText();
+ });
+ data.setCallbackDoubleWithDataArg("getDistance", (BaseData params) -> {
+ return getDistance(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"));
+ });
+ data.setCallbackDoubleWithDataArg("getDistanceSq", (BaseData params) -> {
+ return getDistanceSq(params.getDouble("x"), params.getDouble("y"), params.getDouble("z"));
+ });
+ data.setCallbackDouble("getMountedYOffset", () -> {
+ return getMountedYOffset();
+ });
+ data.setCallbackInt("getEntityId", () -> {
+ return getEntityId();
+ });
+ data.setCallbackString("getEntityString", () -> {
+ return getEntityString();
+ });
+ data.setCallbackFloat("getEyeHeight", () -> {
+ return getEyeHeight();
+ });
+ data.setCallbackBooleanWithDataArg("getFlag", (BaseData params) -> {
+ return getFlag(params.getInt("flag"));
+ });
+ data.setCallbackInt("getMaxFallHeight", () -> {
+ return getMaxFallHeight();
+ });
+ data.setCallbackInt("getMaxInPortalTime", () -> {
+ return getMaxInPortalTime();
+ });
+ data.setCallbackString("getName", () -> {
+ return getName();
+ });
+ data.setCallbackObjectArr("getParts", () -> {
+ Entity[] entityArr = getParts();
+ ModData[] arr = new ModData[entityArr.length];
+ for (int i = 0; i < entityArr.length; i++) {
+ if (entityArr[i] != null) {
+ arr[i] = entityArr[i].makeModData();
+ } else {
+ arr[i] = new ModData();
+ }
+ }
+ return arr;
+ });
+ data.setCallbackInt("getPortalCooldown", () -> {
+ return getPortalCooldown();
+ });
+ data.setCallbackFloat("getRotationYawHead", () -> {
+ return getRotationYawHead();
+ });
+ data.setCallbackString("getSplashSound", () -> {
+ return getSplashSound();
+ });
+ data.setCallbackString("getSwimSound", () -> {
+ return getSwimSound();
+ });
+ data.setCallbackDouble("getYOffset", () -> {
+ return getYOffset();
+ });
+ data.setCallbackString("getClassName", () -> {
+ return getClass().getSimpleName();
+ });
+ data.setCallbackObject("getPositionVector", () -> {
+ return getPositionVector().makeModData();
+ });
+ data.setCallbackObjectWithDataArg("getPositionEyes", (BaseData params) -> {
+ return getPositionEyes(params.getFloat("partialTicks")).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("getLook", (BaseData params) -> {
+ return getLook(params.getFloat("partialTicks")).makeModData();
+ });
+ data.setCallbackObject("getLookVec", () -> {
+ return getLookVec().makeModData();
+ });
+ data.setCallbackObjectWithDataArg("getVectorForRotation", (BaseData params) -> {
+ return getVectorForRotation(params.getFloat("yaw"), params.getFloat("pitch")).makeModData();
+ });
+ data.setCallbackString("getSplashSound", () -> {
+ return getSplashSound();
+ });
+ data.setCallbackString("getSwimSound", () -> {
+ return getSwimSound();
+ });
+ data.setCallbackString("toNBT", () -> {
+ return toNBT();
+ });
+ data.setCallbackVoidWithDataArg("fromNBT", (BaseData params) -> {
+ fromNBT(params.getString("nbt"));
+ });
+ return data;
+ }
+
> CHANGE 418 : 420 @ 418 : 419
~ this.entityUniqueID = new EaglercraftUUID(tagCompund.getLong("UUIDMost"),
~ tagCompund.getLong("UUIDLeast"));
@ -92,7 +476,25 @@
~ return HString.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]",
> CHANGE 121 : 122 @ 121 : 122
> INSERT 24 : 39 @ 24
+ public String toNBT() {
+ NBTTagCompound nbt = new NBTTagCompound();
+ writeToNBT(nbt);
+ return nbt.toString();
+ }
+
+ public void fromNBT(String nbt) {
+ try {
+ NBTTagCompound nbtParsed = JsonToNBT.getTagFromJson(nbt);
+ this.readFromNBT(nbtParsed);
+ } catch (Exception e) {
+ // Swallowing the error!
+ }
+ }
+
> CHANGE 97 : 98 @ 97 : 98
~ public EaglercraftUUID getUniqueID() {

View File

@ -9,8 +9,11 @@
+
> CHANGE 4 : 6 @ 4 : 6
> CHANGE 4 : 9 @ 4 : 6
~
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
@ -25,7 +28,315 @@
~ private static final EaglercraftUUID sprintingSpeedBoostModifierUUID = EaglercraftUUID
~ .fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
> CHANGE 264 : 265 @ 264 : 265
> INSERT 75 : 380 @ 75
+ @Override
+ public void loadModData(BaseData data) {
+ super.loadModData(data);
+ isSwingInProgress = data.getBoolean("isSwingInProgress");
+ arrowHitTimer = data.getInt("arrowHitTimer");
+ hurtTime = data.getInt("hurtTime");
+ maxHurtTime = data.getInt("maxHurtTime");
+ swingProgressInt = data.getInt("swingProgressInt");
+ attackedAtYaw = data.getFloat("attackedAtYaw");
+ deathTime = data.getInt("deathTime");
+
+ prevSwingProgress = data.getFloat("prevSwingProgress");
+ swingProgress = data.getFloat("swingProgress");
+ prevLimbSwingAmount = data.getFloat("prevLimbSwingAmount");
+ limbSwingAmount = data.getFloat("limbSwingAmount");
+ limbSwing = data.getFloat("limbSwing");
+ maxHurtResistantTime = data.getInt("maxHurtResistantTime");
+ prevCameraPitch = data.getFloat("prevCameraPitch");
+ cameraPitch = data.getFloat("cameraPitch");
+ renderYawOffset = data.getFloat("renderYawOffset");
+ prevRenderYawOffset = data.getFloat("prevRenderYawOffset");
+ rotationYawHead = data.getFloat("rotationYawHead");
+ prevRotationYawHead = data.getFloat("prevRotationYawHead");
+ jumpMovementFactor = data.getFloat("jumpMovementFactor");
+
+ recentlyHit = data.getInt("recentlyHit");
+ dead = data.getBoolean("dead");
+ entityAge = data.getInt("entityAge");
+ onGroundSpeedFactor = data.getFloat("onGroundSpeedFactor");
+ prevOnGroundSpeedFactor = data.getFloat("prevOnGroundSpeedFactor");
+ movedDistance = data.getFloat("movedDistance");
+ prevMovedDistance = data.getFloat("prevMovedDistance");
+ scoreValue = data.getInt("scoreValue");
+ lastDamage = data.getFloat("lastDamage");
+ isJumping = data.getBoolean("isJumping");
+
+ moveForward = data.getFloat("moveForward");
+ moveStrafing = data.getFloat("moveStrafing");
+ randomYawVelocity = data.getFloat("randomYawVelocity");
+ newPosRotationIncrements = data.getInt("newPosRotationIncrements");
+ newPosX = data.getDouble("newPosX");
+ newPosY = data.getDouble("newPosY");
+ newPosZ = data.getDouble("newPosZ");
+ newRotationPitch = data.getDouble("newRotationPitch");
+ newRotationYaw = data.getDouble("newRotationYaw");
+ revengeTimer = data.getInt("revengeTimer");
+ lastAttackerTime = data.getInt("lastAttackerTime");
+ landMovementFactor = data.getFloat("landMovementFactor");
+ jumpTicks = data.getInt("jumpTicks");
+ absorptionAmount = data.getFloat("absorptionAmount");
+ }
+
+ @Override
+ public ModData makeModData() {
+ ModData data = super.makeModData();
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.setCallbackObjectArr("getPreviousEquipment", () -> {
+ ModData[] itemstackBaseDatas = new ModData[previousEquipment.length];
+ for (int i = 0; i < previousEquipment.length; i++) {
+ if (previousEquipment[i] != null) {
+ itemstackBaseDatas[i] = previousEquipment[i].makeModData();
+ }
+ }
+ return itemstackBaseDatas;
+ });
+ data.setCallbackObject("getAttackingPlayer", () -> {
+ if (attackingPlayer != null) {
+ return attackingPlayer.makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackObject("getLastAttacker", () -> {
+ if (lastAttacker != null) {
+ return lastAttacker.makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackObject("getEntityLivingToAttack", () -> {
+ if (entityLivingToAttack != null) {
+ return entityLivingToAttack.makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackVoidWithDataArg("setEntityLivingToAttack", (BaseData params) -> {
+ if (params.getBaseData("entity") instanceof EntityLivingBase) {
+ entityLivingToAttack = (EntityLivingBase) params.getBaseData("entity");
+ }
+ });
+ data.set("isSwingInProgress", isSwingInProgress);
+ data.set("arrowHitTimer", arrowHitTimer);
+ data.set("hurtTime", hurtTime);
+ data.set("maxHurtTime", maxHurtTime);
+ data.set("swingProgressInt", swingProgressInt);
+ data.set("attackedAtYaw", attackedAtYaw);
+ data.set("deathTime", deathTime);
+
+ data.set("prevSwingProgress", prevSwingProgress);
+ data.set("swingProgress", swingProgress);
+ data.set("prevLimbSwingAmount", prevLimbSwingAmount);
+ data.set("limbSwingAmount", limbSwingAmount);
+ data.set("limbSwing", limbSwing);
+ data.set("maxHurtResistantTime", maxHurtResistantTime);
+
+ data.set("prevCameraPitch", prevCameraPitch);
+ data.set("cameraPitch", cameraPitch);
+ data.set("renderYawOffset", renderYawOffset);
+ data.set("prevRenderYawOffset", prevRenderYawOffset);
+ data.set("rotationYawHead", rotationYawHead);
+ data.set("prevRotationYawHead", prevRotationYawHead);
+ data.set("jumpMovementFactor", jumpMovementFactor);
+
+ data.set("recentlyHit", recentlyHit);
+ data.set("dead", dead);
+ data.set("entityAge", entityAge);
+ data.set("onGroundSpeedFactor", onGroundSpeedFactor);
+ data.set("movedDistance", movedDistance);
+ data.set("prevOnGroundSpeedFactor", prevOnGroundSpeedFactor);
+ data.set("prevMovedDistance", prevMovedDistance);
+ data.set("scoreValue", scoreValue);
+ data.set("lastDamage", lastDamage);
+ data.set("isJumping", isJumping);
+
+ data.set("moveForward", moveForward);
+ data.set("moveStrafing", moveStrafing);
+ data.set("randomYawVelocity", randomYawVelocity);
+ data.set("newPosRotationIncrements", newPosRotationIncrements);
+ data.set("newPosX", newPosX);
+ data.set("newPosY", newPosY);
+ data.set("newPosZ", newPosZ);
+ data.set("newRotationPitch", newRotationPitch);
+ data.set("newRotationYaw", newRotationYaw);
+ data.set("revengeTimer", revengeTimer);
+ data.set("lastAttackerTime", lastAttackerTime);
+ data.set("landMovementFactor", landMovementFactor);
+ data.set("jumpTicks", jumpTicks);
+ data.set("absorptionAmount", absorptionAmount);
+
+ data.setCallbackBoolean("canBreatheUnderwater", () -> {
+ return canBreatheUnderwater();
+ });
+ data.setCallbackBoolean("isChild", () -> {
+ return isChild();
+ });
+ data.setCallbackBoolean("canDropLoot", () -> {
+ return canDropLoot();
+ });
+ data.setCallbackIntWithDataArg("decreaseAirSupply", (BaseData params) -> {
+ return decreaseAirSupply(params.getInt("parInt1"));
+ });
+ data.setCallbackBoolean("isPlayer", () -> {
+ return isPlayer();
+ });
+ data.setCallbackObject("getAITarget", () -> {
+ return getAITarget().makeModData();
+ });
+ data.setCallbackInt("getRevengeTimer", () -> {
+ return getRevengeTimer();
+ });
+ data.setCallbackInt("getLastAttackerTime", () -> {
+ return getLastAttackerTime();
+ });
+ data.setCallbackInt("getAge", () -> {
+ return getAge();
+ });
+ data.setCallbackVoid("clearActivePotions", () -> {
+ clearActivePotions();
+ });
+ data.setCallbackBooleanWithDataArg("isPotionActive", (BaseData params) -> {
+ return isPotionActive(params.getInt("potionId"));
+ });
+ data.setCallbackBoolean("isEntityUndead", () -> {
+ return isEntityUndead();
+ });
+ data.setCallbackVoidWithDataArg("removePotionEffectClient", (BaseData params) -> {
+ removePotionEffectClient(params.getInt("potionId"));
+ });
+ data.setCallbackVoidWithDataArg("removePotionEffect", (BaseData params) -> {
+ removePotionEffect(params.getInt("potionId"));
+ });
+ data.setCallbackVoidWithDataArg("heal", (BaseData params) -> {
+ heal(params.getFloat("f"));
+ });
+ data.setCallbackFloat("getHealth", () -> {
+ return getHealth();
+ });
+ data.setCallbackVoidWithDataArg("setHealth", (BaseData params) -> {
+ setHealth(params.getFloat("health"));
+ });
+ data.setCallbackString("getHurtSound", () -> {
+ return getHurtSound();
+ });
+ data.setCallbackString("getDeathSound", () -> {
+ return getDeathSound();
+ });
+ data.setCallbackVoid("addRandomDrop", () -> {
+ addRandomDrop();
+ });
+ data.setCallbackBoolean("isOnLadder", () -> {
+ return isOnLadder();
+ });
+ data.setCallbackBoolean("isEntityAlive", () -> {
+ return isEntityAlive();
+ });
+ data.setCallbackVoidWithDataArg("fall", (BaseData params) -> {
+ fall(params.getFloat("f"), params.getFloat("f1"));
+ });
+ data.setCallbackStringWithDataArg("getFallSoundString", (BaseData params) -> {
+ return getFallSoundString(params.getInt("damageValue"));
+ });
+ data.setCallbackVoid("performHurtAnimation", () -> {
+ performHurtAnimation();
+ });
+ data.setCallbackInt("getTotalArmorValue", () -> {
+ return getTotalArmorValue();
+ });
+ data.setCallbackVoidWithDataArg("damageArmor", (BaseData params) -> {
+ damageArmor(params.getFloat("parFloat1"));
+ });
+ data.setCallbackFloat("getMaxHealth", () -> {
+ return getMaxHealth();
+ });
+ data.setCallbackInt("getArrowCountInEntity", () -> {
+ return getArrowCountInEntity();
+ });
+ data.setCallbackVoidWithDataArg("setArrowCountInEntity", (BaseData params) -> {
+ setArrowCountInEntity(params.getInt("count"));
+ });
+ data.setCallbackVoid("swingItem", () -> {
+ swingItem();
+ });
+ data.setCallbackVoid("kill", () -> {
+ kill();
+ });
+ data.setCallbackVoidWithDataArg("setSprinting", (BaseData params) -> {
+ setSprinting(params.getBoolean("flag"));
+ });
+ data.setCallbackFloat("getSoundVolume", () -> {
+ return getSoundVolume();
+ });
+ data.setCallbackFloat("getSoundPitch", () -> {
+ return getSoundPitch();
+ });
+ data.setCallbackBoolean("isMovementBlocked", () -> {
+ return isMovementBlocked();
+ });
+ data.setCallbackFloat("getJumpUpwardsMotion", () -> {
+ return getJumpUpwardsMotion();
+ });
+ data.setCallbackVoid("jump", () -> {
+ jump();
+ });
+ data.setCallbackVoid("updateAITick", () -> {
+ updateAITick();
+ });
+ data.setCallbackVoid("handleJumpLava", () -> {
+ handleJumpLava();
+ });
+ data.setCallbackFloat("getAIMoveSpeed", () -> {
+ return getAIMoveSpeed();
+ });
+ data.setCallbackVoidWithDataArg("setAIMoveSpeed", (BaseData params) -> {
+ setAIMoveSpeed(params.getFloat("speedIn"));
+ });
+ data.setCallbackVoid("collideWithNearbyEntities", () -> {
+ collideWithNearbyEntities();
+ });
+ data.setCallbackVoidWithDataArg("setJumping", (BaseData params) -> {
+ setJumping(params.getBoolean("parFlag"));
+ });
+ data.setCallbackBoolean("canBeCollidedWith", () -> {
+ return canBeCollidedWith();
+ });
+ data.setCallbackBoolean("canBePushed", () -> {
+ return canBePushed();
+ });
+ data.setCallbackVoid("setBeenAttacked", () -> {
+ setBeenAttacked();
+ });
+ data.setCallbackFloat("getRotationYawHead", () -> {
+ return getRotationYawHead();
+ });
+ data.setCallbackVoidWithDataArg("setRotationYawHead", (BaseData params) -> {
+ setRotationYawHead(params.getFloat("f"));
+ });
+ data.setCallbackFloat("getAbsorptionAmount", () -> {
+ return getAbsorptionAmount();
+ });
+ data.setCallbackVoidWithDataArg("setAbsorptionAmount", (BaseData params) -> {
+ setAbsorptionAmount(params.getFloat("amount"));
+ });
+ data.setCallbackVoid("markPotionsDirty", () -> {
+ markPotionsDirty();
+ });
+
+ return data;
+ }
+
> CHANGE 189 : 190 @ 189 : 190
~ public EaglercraftRandom getRNG() {

View File

@ -5,8 +5,10 @@
# Version: 1.0
# Author: lax1dude
> CHANGE 4 : 6 @ 4 : 5
> CHANGE 4 : 8 @ 4 : 5
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
~
@ -24,7 +26,426 @@
~ public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender {
> CHANGE 458 : 459 @ 458 : 459
> INSERT 51 : 467 @ 51
+ @Override
+ public void loadModData(BaseData data) {
+ super.loadModData(data);
+ cameraYaw = data.getFloat("cameraYaw");
+ chasingPosX = data.getDouble("chasingPosX");
+ chasingPosY = data.getDouble("chasingPosY");
+ chasingPosZ = data.getDouble("chasingPosZ");
+ experience = data.getFloat("experience");
+ experienceLevel = data.getInt("experienceLevel");
+ experienceTotal = data.getInt("experienceTotal");
+ if (fishEntity != null) {
+ fishEntity.loadModData(data.getBaseData("fishEntity"));
+ }
+ if (foodStats != null) {
+ foodStats.loadModData(data.getBaseData("foodStats"));
+ }
+ if (inventory != null) {
+ inventory.loadModData(data.getBaseData("inventory"));
+ }
+ flyToggleTimer = data.getInt("flyToggleTimer");
+ hasReducedDebug = data.getBoolean("hasReducedDebug");
+ lastXPSound = data.getInt("lastXPSound");
+ sleepTimer = data.getInt("sleepTimer");
+ sleeping = data.getBoolean("sleeping");
+ spawnForced = data.getBoolean("spawnForced");
+ speedInAir = data.getFloat("speedInAir");
+ speedOnGround = data.getFloat("speedOnGround");
+ xpCooldown = data.getInt("xpCooldown");
+ xpSeed = data.getInt("xpSeed");
+ if (itemInUse != null) {
+ itemInUse.loadModData(data.getBaseData("itemInUse"));
+ }
+
+ if (inventoryContainer != null) {
+ inventoryContainer.loadModData(data.getBaseData("inventoryContainer"));
+ }
+
+ if (openContainer != null) {
+ openContainer.loadModData(data.getBaseData("openContainer"));
+ }
+ if (capabilities != null) {
+ capabilities.loadModData(data.getBaseData("capabilities"));
+ }
+ }
+
+ @Override
+ public ModData makeModData() {
+ ModData data = super.makeModData();
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.set("cameraYaw", cameraYaw);
+ data.set("chasingPosX", chasingPosX);
+ data.set("chasingPosY", chasingPosY);
+ data.set("chasingPosZ", chasingPosZ);
+ data.set("experience", experience);
+ data.set("experienceLevel", experienceLevel);
+ data.set("experienceTotal", experienceTotal);
+ if (fishEntity != null) {
+ data.set("fishEntity", fishEntity.makeModData());
+ }
+ if (itemInUse != null) {
+ data.set("itemInUse", itemInUse.makeModData());
+ }
+ if (foodStats != null) {
+ data.set("foodStats", foodStats.makeModData());
+ }
+ data.set("flyToggleTimer", flyToggleTimer);
+ data.set("hasReducedDebug", hasReducedDebug);
+ data.set("itemInUseCount", itemInUseCount);
+ data.set("lastXPSound", lastXPSound);
+ data.set("sleepTimer", sleepTimer);
+ data.set("sleeping", sleeping);
+ data.set("spawnForced", spawnForced);
+ data.set("speedInAir", speedInAir);
+ data.set("speedOnGround", speedOnGround);
+ data.set("xpCooldown", xpCooldown);
+ data.set("xpSeed", xpSeed);
+
+ if (inventoryContainer != null) {
+ data.set("inventoryContainer", inventoryContainer.makeModData());
+ }
+
+ if (openContainer != null) {
+ data.set("openContainer", openContainer.makeModData());
+ }
+ if (inventory != null) {
+ data.set("inventory", inventory.makeModData());
+ }
+ if (capabilities != null) {
+ data.set("capabilities", capabilities.makeModData());
+ }
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+
+ // Todone: adding functions
+
+ data.setCallbackObject("getItemInUse", () -> {
+ if (getItemInUse() != null) {
+ return getItemInUse().makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackInt("getItemInUseCount", () -> {
+ return getItemInUseCount();
+ });
+ data.setCallbackBoolean("isUsingItem", () -> {
+ return isUsingItem();
+ });
+ data.setCallbackInt("getItemInUseDuration", () -> {
+ return getItemInUseDuration();
+ });
+ data.setCallbackVoid("stopUsingItem", () -> {
+ stopUsingItem();
+ });
+ data.setCallbackVoid("clearItemInUse", () -> {
+ clearItemInUse();
+ });
+ data.setCallbackBoolean("isBlocking", () -> {
+ return isBlocking();
+ });
+ data.setCallbackInt("getMaxInPortalTime", () -> {
+ return getMaxInPortalTime();
+ });
+ data.setCallbackString("getSwimSound", () -> {
+ return getSwimSound();
+ });
+ data.setCallbackString("getSplashSound", () -> {
+ return getSplashSound();
+ });
+ data.setCallbackInt("getPortalCooldown", () -> {
+ return getPortalCooldown();
+ });
+ data.setCallbackVoidWithDataArg("playSound", (BaseData params) -> {
+ playSound(params.getString("s"), params.getFloat("f"), params.getFloat("f1"));
+ });
+ data.setCallbackVoidWithDataArg("updateItemUse", (BaseData params) -> {
+ updateItemUse((ItemStack) params.getRef("itemStackIn"), params.getInt("parInt1"));
+ });
+ data.setCallbackVoid("onItemUseFinish", () -> {
+ onItemUseFinish();
+ });
+ data.setCallbackVoidWithDataArg("handleStatusUpdate", (BaseData params) -> {
+ handleStatusUpdate(params.getByte("b0"));
+ });
+ data.setCallbackBoolean("isMovementBlocked", () -> {
+ return isMovementBlocked();
+ });
+ data.setCallbackVoid("closeScreen", () -> {
+ closeScreen();
+ });
+ data.setCallbackVoid("updateRidden", () -> {
+ updateRidden();
+ });
+ data.setCallbackVoid("preparePlayerToSpawn", () -> {
+ preparePlayerToSpawn();
+ });
+ data.setCallbackVoid("updateEntityActionState", () -> {
+ updateEntityActionState();
+ });
+ data.setCallbackVoid("onLivingUpdate", () -> {
+ onLivingUpdate();
+ });
+ data.setCallbackVoidWithDataArg("collideWithPlayer", (BaseData params) -> {
+ collideWithPlayer((Entity) params.getRef("parEntity"));
+ });
+ data.setCallbackInt("getScore", () -> {
+ return getScore();
+ });
+ data.setCallbackVoidWithDataArg("addScore", (BaseData params) -> {
+ addScore(params.getInt("parInt1"));
+ });
+ data.setCallbackString("getHurtSound", () -> {
+ return getHurtSound();
+ });
+ data.setCallbackString("getDeathSound", () -> {
+ return getDeathSound();
+ });
+ data.setCallbackVoidWithDataArg("addToPlayerScore", (BaseData params) -> {
+ addToPlayerScore((Entity) params.getRef("entity"), params.getInt("i"));
+ });
+ data.setCallbackObjectWithDataArg("dropOneItem", (BaseData params) -> {
+ return dropOneItem(params.getBoolean("flag")).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("dropPlayerItemWithRandomChoice", (BaseData params) -> {
+ // The second argument (boolean) is not used.
+ return dropPlayerItemWithRandomChoice((ItemStack) params.getRef("itemStackIn"), false).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("dropItem", (BaseData params) -> {
+ return dropItem((ItemStack) params.getRef("droppedItem"), params.getBoolean("dropAround"),
+ params.getBoolean("traceItem")).makeModData();
+ });
+ data.setCallbackVoidWithDataArg("joinEntityItemWithWorld", (BaseData params) -> {
+ joinEntityItemWithWorld((EntityItem) params.getRef("entityitem"));
+ });
+ data.setCallbackFloatWithDataArg("getToolDigEfficiency", (BaseData params) -> {
+ return getToolDigEfficiency((Block) params.getRef("parBlock"));
+ });
+ data.setCallbackBooleanWithDataArg("canHarvestBlock", (BaseData params) -> {
+ return canHarvestBlock((Block) params.getRef("blockToHarvest"));
+ });
+ data.setCallbackBooleanWithDataArg("canAttackPlayer", (BaseData params) -> {
+ return canAttackPlayer((EntityPlayer) params.getRef("entityplayer"));
+ });
+ data.setCallbackVoidWithDataArg("damageArmor", (BaseData params) -> {
+ damageArmor(params.getFloat("f"));
+ });
+ data.setCallbackInt("getTotalArmorValue", () -> {
+ return getTotalArmorValue();
+ });
+ data.setCallbackFloat("getArmorVisibility", () -> {
+ return getArmorVisibility();
+ });
+ data.setCallbackBooleanWithDataArg("interactWith", (BaseData params) -> {
+ return interactWith((Entity) params.getRef("parEntity"));
+ });
+ data.setCallbackObject("getCurrentEquippedItem", () -> {
+ if (getCurrentEquippedItem() != null) {
+ return getCurrentEquippedItem().makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackVoid("destroyCurrentEquippedItem", () -> {
+ destroyCurrentEquippedItem();
+ });
+ data.setCallbackDouble("getYOffset", () -> {
+ return getYOffset();
+ });
+ data.setCallbackVoidWithDataArg("attackTargetEntityWithCurrentItem", (BaseData params) -> {
+ attackTargetEntityWithCurrentItem((Entity) params.getRef("entity"));
+ });
+ data.setCallbackVoid("respawnPlayer", () -> {
+ respawnPlayer();
+ });
+ data.setCallbackBoolean("isEntityInsideOpaqueBlock", () -> {
+ return isEntityInsideOpaqueBlock();
+ });
+ data.setCallbackBoolean("isUser", () -> {
+ return isUser();
+ });
+ data.setCallbackStringWithDataArg("trySleep", (BaseData params) -> {
+ return trySleep((BlockPos) params.getRef("blockpos")).name();
+ });
+ data.setCallbackVoidWithDataArg("wakeUpPlayer", (BaseData params) -> {
+ wakeUpPlayer(params.getBoolean("flag"), params.getBoolean("flag1"), params.getBoolean("flag2"));
+ });
+ data.setCallbackBoolean("isInBed", () -> {
+ return isInBed();
+ });
+ data.setCallbackFloat("getBedOrientationInDegrees", () -> {
+ return getBedOrientationInDegrees();
+ });
+ data.setCallbackBoolean("isPlayerSleeping", () -> {
+ return isPlayerSleeping();
+ });
+ data.setCallbackBoolean("isPlayerFullyAsleep", () -> {
+ return isPlayerFullyAsleep();
+ });
+ data.setCallbackInt("getSleepTimer", () -> {
+ return getSleepTimer();
+ });
+ data.setCallbackObject("getBedLocation", () -> {
+ if (getBedLocation() != null) {
+ return getBedLocation().makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackBoolean("isSpawnForced", () -> {
+ return isSpawnForced();
+ });
+ data.setCallbackVoidWithDataArg("setSpawnPoint", (BaseData params) -> {
+ setSpawnPoint((BlockPos) params.getRef("pos"), params.getBoolean("forced"));
+ });
+ data.setCallbackVoidWithDataArg("moveEntityWithHeading", (BaseData params) -> {
+ moveEntityWithHeading(params.getFloat("f"), params.getFloat("f1"));
+ });
+ data.setCallbackFloat("getAIMoveSpeed", () -> {
+ return getAIMoveSpeed();
+ });
+ data.setCallbackVoidWithDataArg("addMovementStat", (BaseData params) -> {
+ addMovementStat(params.getDouble("parDouble1"), params.getDouble("parDouble2"),
+ params.getDouble("parDouble3"));
+ });
+ data.setCallbackVoidWithDataArg("addMountedMovementStat", (BaseData params) -> {
+ addMountedMovementStat(params.getDouble("parDouble1"), params.getDouble("parDouble2"),
+ params.getDouble("parDouble3"));
+ });
+ data.setCallbackVoidWithDataArg("fall", (BaseData params) -> {
+ fall(params.getFloat("f"), params.getFloat("f1"));
+ });
+ data.setCallbackVoid("resetHeight", () -> {
+ resetHeight();
+ });
+ data.setCallbackStringWithDataArg("getFallSoundString", (BaseData params) -> {
+ return getFallSoundString(params.getInt("i"));
+ });
+ data.setCallbackVoid("setInWeb", () -> {
+ setInWeb();
+ });
+ data.setCallbackObjectWithDataArg("getCurrentArmor", (BaseData params) -> {
+ if (getCurrentArmor(params.getInt("i")) != null) {
+ return getCurrentArmor(params.getInt("i")).makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackVoidWithDataArg("addExperience", (BaseData params) -> {
+ addExperience(params.getInt("amount"));
+ });
+ data.setCallbackInt("getXPSeed", () -> {
+ return getXPSeed();
+ });
+ data.setCallbackVoidWithDataArg("removeExperienceLevel", (BaseData params) -> {
+ removeExperienceLevel(params.getInt("i"));
+ });
+ data.setCallbackVoidWithDataArg("addExperienceLevel", (BaseData params) -> {
+ addExperienceLevel(params.getInt("i"));
+ });
+ data.setCallbackInt("xpBarCap", () -> {
+ return xpBarCap();
+ });
+ data.setCallbackVoidWithDataArg("addExhaustion", (BaseData params) -> {
+ addExhaustion(params.getFloat("parFloat1"));
+ });
+ data.setCallbackObject("getFoodStats", () -> {
+ return getFoodStats().makeModData();
+ });
+ data.setCallbackBooleanWithDataArg("canEat", (BaseData params) -> {
+ return canEat(params.getBoolean("ignoreHunger"));
+ });
+ data.setCallbackBoolean("shouldHeal", () -> {
+ return shouldHeal();
+ });
+ data.setCallbackVoidWithDataArg("setItemInUse", (BaseData params) -> {
+ setItemInUse((ItemStack) params.getRef("itemstack"), params.getInt("i"));
+ });
+ data.setCallbackBoolean("isAllowEdit", () -> {
+ return isAllowEdit();
+ });
+ data.setCallbackBooleanWithDataArg("canPlayerEdit", (BaseData params) -> {
+ return canPlayerEdit((BlockPos) params.getRef("parBlockPos"),
+ EnumFacing.valueOf(params.getString("parEnumFacing")), (ItemStack) params.getRef("parItemStack"));
+ });
+ data.setCallbackBoolean("isPlayer", () -> {
+ return isPlayer();
+ });
+ data.setCallbackBoolean("getAlwaysRenderNameTagForRender", () -> {
+ return getAlwaysRenderNameTagForRender();
+ });
+ data.setCallbackVoidWithDataArg("clonePlayer", (BaseData params) -> {
+ clonePlayer((EntityPlayer) params.getRef("entityplayer"), params.getBoolean("flag"));
+ });
+ data.setCallbackBoolean("canTriggerWalking", () -> {
+ return canTriggerWalking();
+ });
+ data.setCallbackVoid("sendPlayerAbilities", () -> {
+ sendPlayerAbilities();
+ });
+ data.setCallbackString("getName", () -> {
+ return getName();
+ });
+ data.setCallbackObjectWithDataArg("getEquipmentInSlot", (BaseData params) -> {
+ if (getEquipmentInSlot(params.getInt("i")) != null) {
+ return getEquipmentInSlot(params.getInt("i")).makeModData();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackObject("getHeldItem", () -> {
+ if (getHeldItem() != null) {
+ return getHeldItem();
+ } else {
+ return new ModData();
+ }
+ });
+ data.setCallbackVoidWithDataArg("setCurrentItemOrArmor", (BaseData params) -> {
+ setCurrentItemOrArmor(params.getInt("i"), (ItemStack) params.getRef("itemstack"));
+ });
+ data.setCallbackBooleanWithDataArg("isInvisibleToPlayer", (BaseData params) -> {
+ return isInvisibleToPlayer((EntityPlayer) params.getRef("entityplayer"));
+ });
+ data.setCallbackObjectArr("getInventory", () -> {
+ ItemStack[] inventory = getInventory();
+ ModData[] parDatas = new ModData[inventory.length];
+ for (int i = 0; i < inventory.length; i++) {
+ if (inventory[i] != null) {
+ parDatas[i] = inventory[i].makeModData();
+ }
+ }
+ return parDatas;
+ });
+ data.setCallbackBoolean("isPushedByWater", () -> {
+ return isPushedByWater();
+ });
+ data.setCallbackFloat("getEyeHeight", () -> {
+ return getEyeHeight();
+ });
+ data.setCallbackStringWithDataArg("getOfflineUUID", (BaseData params) -> {
+ return getOfflineUUID(params.getString("username")).toString();
+ });
+ data.setCallbackBooleanWithDataArg("replaceItemInInventory", (BaseData params) -> {
+ return replaceItemInInventory(params.getInt("i"), (ItemStack) params.getRef("itemstack"));
+ });
+ data.setCallbackBoolean("hasReducedDebug", () -> {
+ return hasReducedDebug();
+ });
+ data.setCallbackVoidWithDataArg("setReducedDebug", (BaseData params) -> {
+ setReducedDebug(params.getBoolean("reducedDebug"));
+ });
+ return data;
+ }
+
> CHANGE 407 : 408 @ 407 : 408
~ Collection<ScoreObjective> collection = this.getWorldScoreboard()

View File

@ -5,10 +5,70 @@
# Version: 1.0
# Author: lax1dude
> INSERT 3 : 4 @ 3
> INSERT 3 : 6 @ 3
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
> DELETE 3 @ 3 : 4
> CHANGE 12 : 13 @ 12 : 13
~ public class InventoryPlayer extends ModData implements IInventory {
> INSERT 11 : 62 @ 11
+ public void loadModData(BaseData data) {
+ BaseData[] parItemStacks = data.getBaseDataArr("mainInventory");
+ for (int i = 0; i < parItemStacks.length && i < mainInventory.length; i++) {
+ if (mainInventory[i] != null) {
+ mainInventory[i].loadModData(parItemStacks[i]);
+ } else if (parItemStacks[i] != null && parItemStacks[i].getRef() instanceof ItemStack) {
+ mainInventory[i] = (ItemStack) parItemStacks[i].getRef();
+ }
+ }
+
+ BaseData[] parArmorStacks = data.getBaseDataArr("armorInventory");
+ for (int i = 0; i < parArmorStacks.length && i < armorInventory.length; i++) {
+ if (armorInventory[i] != null) {
+ armorInventory[i].loadModData(parArmorStacks[i]);
+ } else if (parItemStacks[i] != null && parItemStacks[i].getRef() instanceof ItemStack) {
+ armorInventory[i] = (ItemStack) parItemStacks[i].getRef();
+ }
+ }
+ currentItem = data.getInt("currentItem");
+ inventoryChanged = data.getBoolean("inventoryChanged");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ ModData[] parBaseDatas = new ModData[mainInventory.length];
+ for (int i = 0; i < mainInventory.length; i++) {
+ if (mainInventory[i] != null) {
+ parBaseDatas[i] = mainInventory[i].makeModData();
+ }
+ }
+ data.set("mainInventory", parBaseDatas);
+
+ ModData[] parBaseDatasArmor = new ModData[armorInventory.length];
+ for (int i = 0; i < armorInventory.length; i++) {
+ if (armorInventory[i] != null) {
+ parBaseDatasArmor[i] = armorInventory[i].makeModData();
+ }
+ }
+ data.set("armorInventory", parBaseDatasArmor);
+
+ data.set("currentItem", currentItem);
+ data.set("inventoryChanged", inventoryChanged);
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ return data;
+ }
+
> EOF

View File

@ -0,0 +1,61 @@
# Eagler Context Redacted Diff
# Copyright (c) 2024 lax1dude. All rights reserved.
# Version: 1.0
# Author: lax1dude
> INSERT 2 : 4 @ 2
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
> CHANGE 2 : 3 @ 2 : 3
~ public class PlayerCapabilities extends ModData {
> INSERT 8 : 49 @ 8
+ public void loadModData(BaseData data) {
+ disableDamage = data.getBoolean("disableDamage");
+ isFlying = data.getBoolean("isFlying");
+ allowFlying = data.getBoolean("allowFlying");
+ isCreativeMode = data.getBoolean("isCreativeMode");
+ allowEdit = data.getBoolean("allowEdit");
+
+ flySpeed = data.getFloat("flySpeed");
+ walkSpeed = data.getFloat("walkSpeed");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("disableDamage", disableDamage);
+ data.set("isFlying", isFlying);
+ data.set("allowFlying", allowFlying);
+ data.set("isCreativeMode", isCreativeMode);
+ data.set("allowEdit", allowEdit);
+ data.set("flySpeed", flySpeed);
+ data.set("walkSpeed", walkSpeed);
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.setCallbackFloat("getFlySpeed", () -> {
+ return getFlySpeed();
+ });
+ data.setCallbackFloat("getWalkSpeed", () -> {
+ return getWalkSpeed();
+ });
+ data.setCallbackVoidWithDataArg("setFlySpeed", (BaseData params) -> {
+ setFlySpeed(params.getFloat("speed"));
+ });
+ data.setCallbackVoidWithDataArg("setPlayerWalkSpeed", (BaseData params) -> {
+ setPlayerWalkSpeed(params.getFloat("speed"));
+ });
+ return data;
+ }
+
> EOF

View File

@ -5,211 +5,232 @@
# Version: 1.0
# Author: lax1dude
> DELETE 34 @ 34 : 35
> INSERT 2 : 3 @ 2
> CHANGE 3 : 201 @ 3 : 201
+ import net.eaglerforge.api.ModData;
~ public static Block air;
~ public static Block stone;
~ public static BlockGrass grass;
~ public static Block dirt;
~ public static Block cobblestone;
~ public static Block planks;
~ public static Block sapling;
~ public static Block bedrock;
~ public static BlockDynamicLiquid flowing_water;
~ public static BlockStaticLiquid water;
~ public static BlockDynamicLiquid flowing_lava;
~ public static BlockStaticLiquid lava;
~ public static BlockSand sand;
~ public static Block gravel;
~ public static Block gold_ore;
~ public static Block iron_ore;
~ public static Block coal_ore;
~ public static Block log;
~ public static Block log2;
~ public static BlockLeaves leaves;
~ public static BlockLeaves leaves2;
~ public static Block sponge;
~ public static Block glass;
~ public static Block lapis_ore;
~ public static Block lapis_block;
~ public static Block dispenser;
~ public static Block sandstone;
~ public static Block noteblock;
~ public static Block bed;
~ public static Block golden_rail;
~ public static Block detector_rail;
~ public static BlockPistonBase sticky_piston;
~ public static Block web;
~ public static BlockTallGrass tallgrass;
~ public static BlockDeadBush deadbush;
~ public static BlockPistonBase piston;
~ public static BlockPistonExtension piston_head;
~ public static Block wool;
~ public static BlockPistonMoving piston_extension;
~ public static BlockFlower yellow_flower;
~ public static BlockFlower red_flower;
~ public static BlockBush brown_mushroom;
~ public static BlockBush red_mushroom;
~ public static Block gold_block;
~ public static Block iron_block;
~ public static BlockSlab double_stone_slab;
~ public static BlockSlab stone_slab;
~ public static Block brick_block;
~ public static Block tnt;
~ public static Block bookshelf;
~ public static Block mossy_cobblestone;
~ public static Block obsidian;
~ public static Block torch;
~ public static BlockFire fire;
~ public static Block mob_spawner;
~ public static Block oak_stairs;
~ public static BlockChest chest;
~ public static BlockRedstoneWire redstone_wire;
~ public static Block diamond_ore;
~ public static Block diamond_block;
~ public static Block crafting_table;
~ public static Block wheat;
~ public static Block farmland;
~ public static Block furnace;
~ public static Block lit_furnace;
~ public static Block standing_sign;
~ public static Block oak_door;
~ public static Block spruce_door;
~ public static Block birch_door;
~ public static Block jungle_door;
~ public static Block acacia_door;
~ public static Block dark_oak_door;
~ public static Block ladder;
~ public static Block rail;
~ public static Block stone_stairs;
~ public static Block wall_sign;
~ public static Block lever;
~ public static Block stone_pressure_plate;
~ public static Block iron_door;
~ public static Block wooden_pressure_plate;
~ public static Block redstone_ore;
~ public static Block lit_redstone_ore;
~ public static Block unlit_redstone_torch;
~ public static Block redstone_torch;
~ public static Block stone_button;
~ public static Block snow_layer;
~ public static Block ice;
~ public static Block snow;
~ public static BlockCactus cactus;
~ public static Block clay;
~ public static BlockReed reeds;
~ public static Block jukebox;
~ public static Block oak_fence;
~ public static Block spruce_fence;
~ public static Block birch_fence;
~ public static Block jungle_fence;
~ public static Block dark_oak_fence;
~ public static Block acacia_fence;
~ public static Block pumpkin;
~ public static Block netherrack;
~ public static Block soul_sand;
~ public static Block glowstone;
~ public static BlockPortal portal;
~ public static Block lit_pumpkin;
~ public static Block cake;
~ public static BlockRedstoneRepeater unpowered_repeater;
~ public static BlockRedstoneRepeater powered_repeater;
~ public static Block trapdoor;
~ public static Block monster_egg;
~ public static Block stonebrick;
~ public static Block brown_mushroom_block;
~ public static Block red_mushroom_block;
~ public static Block iron_bars;
~ public static Block glass_pane;
~ public static Block melon_block;
~ public static Block pumpkin_stem;
~ public static Block melon_stem;
~ public static Block vine;
~ public static Block oak_fence_gate;
~ public static Block spruce_fence_gate;
~ public static Block birch_fence_gate;
~ public static Block jungle_fence_gate;
~ public static Block dark_oak_fence_gate;
~ public static Block acacia_fence_gate;
~ public static Block brick_stairs;
~ public static Block stone_brick_stairs;
~ public static BlockMycelium mycelium;
~ public static Block waterlily;
~ public static Block nether_brick;
~ public static Block nether_brick_fence;
~ public static Block nether_brick_stairs;
~ public static Block nether_wart;
~ public static Block enchanting_table;
~ public static Block brewing_stand;
~ public static BlockCauldron cauldron;
~ public static Block end_portal;
~ public static Block end_portal_frame;
~ public static Block end_stone;
~ public static Block dragon_egg;
~ public static Block redstone_lamp;
~ public static Block lit_redstone_lamp;
~ public static BlockSlab double_wooden_slab;
~ public static BlockSlab wooden_slab;
~ public static Block cocoa;
~ public static Block sandstone_stairs;
~ public static Block emerald_ore;
~ public static Block ender_chest;
~ public static BlockTripWireHook tripwire_hook;
~ public static Block tripwire;
~ public static Block emerald_block;
~ public static Block spruce_stairs;
~ public static Block birch_stairs;
~ public static Block jungle_stairs;
~ public static Block command_block;
~ public static BlockBeacon beacon;
~ public static Block cobblestone_wall;
~ public static Block flower_pot;
~ public static Block carrots;
~ public static Block potatoes;
~ public static Block wooden_button;
~ public static BlockSkull skull;
~ public static Block anvil;
~ public static Block trapped_chest;
~ public static Block light_weighted_pressure_plate;
~ public static Block heavy_weighted_pressure_plate;
~ public static BlockRedstoneComparator unpowered_comparator;
~ public static BlockRedstoneComparator powered_comparator;
~ public static BlockDaylightDetector daylight_detector;
~ public static BlockDaylightDetector daylight_detector_inverted;
~ public static Block redstone_block;
~ public static Block quartz_ore;
~ public static BlockHopper hopper;
~ public static Block quartz_block;
~ public static Block quartz_stairs;
~ public static Block activator_rail;
~ public static Block dropper;
~ public static Block stained_hardened_clay;
~ public static Block barrier;
~ public static Block iron_trapdoor;
~ public static Block hay_block;
~ public static Block carpet;
~ public static Block hardened_clay;
~ public static Block coal_block;
~ public static Block packed_ice;
~ public static Block acacia_stairs;
~ public static Block dark_oak_stairs;
~ public static Block slime_block;
~ public static BlockDoublePlant double_plant;
~ public static BlockStainedGlass stained_glass;
~ public static BlockStainedGlassPane stained_glass_pane;
~ public static Block prismarine;
~ public static Block sea_lantern;
~ public static Block standing_banner;
~ public static Block wall_banner;
~ public static Block red_sandstone;
~ public static Block red_sandstone_stairs;
~ public static BlockSlab double_stone_slab2;
~ public static BlockSlab stone_slab2;
> DELETE 32 @ 32 : 33
> CHANGE 5 : 6 @ 5 : 6
> CHANGE 2 : 3 @ 2 : 201
~ import java.util.Map;
> INSERT 1 : 201 @ 1
+ public class Blocks extends ModData {
+ public static Block air;
+ public static Block stone;
+ public static BlockGrass grass;
+ public static Block dirt;
+ public static Block cobblestone;
+ public static Block planks;
+ public static Block sapling;
+ public static Block bedrock;
+ public static BlockDynamicLiquid flowing_water;
+ public static BlockStaticLiquid water;
+ public static BlockDynamicLiquid flowing_lava;
+ public static BlockStaticLiquid lava;
+ public static BlockSand sand;
+ public static Block gravel;
+ public static Block gold_ore;
+ public static Block iron_ore;
+ public static Block coal_ore;
+ public static Block log;
+ public static Block log2;
+ public static BlockLeaves leaves;
+ public static BlockLeaves leaves2;
+ public static Block sponge;
+ public static Block glass;
+ public static Block lapis_ore;
+ public static Block lapis_block;
+ public static Block dispenser;
+ public static Block sandstone;
+ public static Block noteblock;
+ public static Block bed;
+ public static Block golden_rail;
+ public static Block detector_rail;
+ public static BlockPistonBase sticky_piston;
+ public static Block web;
+ public static BlockTallGrass tallgrass;
+ public static BlockDeadBush deadbush;
+ public static BlockPistonBase piston;
+ public static BlockPistonExtension piston_head;
+ public static Block wool;
+ public static BlockPistonMoving piston_extension;
+ public static BlockFlower yellow_flower;
+ public static BlockFlower red_flower;
+ public static BlockBush brown_mushroom;
+ public static BlockBush red_mushroom;
+ public static Block gold_block;
+ public static Block iron_block;
+ public static BlockSlab double_stone_slab;
+ public static BlockSlab stone_slab;
+ public static Block brick_block;
+ public static Block tnt;
+ public static Block bookshelf;
+ public static Block mossy_cobblestone;
+ public static Block obsidian;
+ public static Block torch;
+ public static BlockFire fire;
+ public static Block mob_spawner;
+ public static Block oak_stairs;
+ public static BlockChest chest;
+ public static BlockRedstoneWire redstone_wire;
+ public static Block diamond_ore;
+ public static Block diamond_block;
+ public static Block crafting_table;
+ public static Block wheat;
+ public static Block farmland;
+ public static Block furnace;
+ public static Block lit_furnace;
+ public static Block standing_sign;
+ public static Block oak_door;
+ public static Block spruce_door;
+ public static Block birch_door;
+ public static Block jungle_door;
+ public static Block acacia_door;
+ public static Block dark_oak_door;
+ public static Block ladder;
+ public static Block rail;
+ public static Block stone_stairs;
+ public static Block wall_sign;
+ public static Block lever;
+ public static Block stone_pressure_plate;
+ public static Block iron_door;
+ public static Block wooden_pressure_plate;
+ public static Block redstone_ore;
+ public static Block lit_redstone_ore;
+ public static Block unlit_redstone_torch;
+ public static Block redstone_torch;
+ public static Block stone_button;
+ public static Block snow_layer;
+ public static Block ice;
+ public static Block snow;
+ public static BlockCactus cactus;
+ public static Block clay;
+ public static BlockReed reeds;
+ public static Block jukebox;
+ public static Block oak_fence;
+ public static Block spruce_fence;
+ public static Block birch_fence;
+ public static Block jungle_fence;
+ public static Block dark_oak_fence;
+ public static Block acacia_fence;
+ public static Block pumpkin;
+ public static Block netherrack;
+ public static Block soul_sand;
+ public static Block glowstone;
+ public static BlockPortal portal;
+ public static Block lit_pumpkin;
+ public static Block cake;
+ public static BlockRedstoneRepeater unpowered_repeater;
+ public static BlockRedstoneRepeater powered_repeater;
+ public static Block trapdoor;
+ public static Block monster_egg;
+ public static Block stonebrick;
+ public static Block brown_mushroom_block;
+ public static Block red_mushroom_block;
+ public static Block iron_bars;
+ public static Block glass_pane;
+ public static Block melon_block;
+ public static Block pumpkin_stem;
+ public static Block melon_stem;
+ public static Block vine;
+ public static Block oak_fence_gate;
+ public static Block spruce_fence_gate;
+ public static Block birch_fence_gate;
+ public static Block jungle_fence_gate;
+ public static Block dark_oak_fence_gate;
+ public static Block acacia_fence_gate;
+ public static Block brick_stairs;
+ public static Block stone_brick_stairs;
+ public static BlockMycelium mycelium;
+ public static Block waterlily;
+ public static Block nether_brick;
+ public static Block nether_brick_fence;
+ public static Block nether_brick_stairs;
+ public static Block nether_wart;
+ public static Block enchanting_table;
+ public static Block brewing_stand;
+ public static BlockCauldron cauldron;
+ public static Block end_portal;
+ public static Block end_portal_frame;
+ public static Block end_stone;
+ public static Block dragon_egg;
+ public static Block redstone_lamp;
+ public static Block lit_redstone_lamp;
+ public static BlockSlab double_wooden_slab;
+ public static BlockSlab wooden_slab;
+ public static Block cocoa;
+ public static Block sandstone_stairs;
+ public static Block emerald_ore;
+ public static Block ender_chest;
+ public static BlockTripWireHook tripwire_hook;
+ public static Block tripwire;
+ public static Block emerald_block;
+ public static Block spruce_stairs;
+ public static Block birch_stairs;
+ public static Block jungle_stairs;
+ public static Block command_block;
+ public static BlockBeacon beacon;
+ public static Block cobblestone_wall;
+ public static Block flower_pot;
+ public static Block carrots;
+ public static Block potatoes;
+ public static Block wooden_button;
+ public static BlockSkull skull;
+ public static Block anvil;
+ public static Block trapped_chest;
+ public static Block light_weighted_pressure_plate;
+ public static Block heavy_weighted_pressure_plate;
+ public static BlockRedstoneComparator unpowered_comparator;
+ public static BlockRedstoneComparator powered_comparator;
+ public static BlockDaylightDetector daylight_detector;
+ public static BlockDaylightDetector daylight_detector_inverted;
+ public static Block redstone_block;
+ public static Block quartz_ore;
+ public static BlockHopper hopper;
+ public static Block quartz_block;
+ public static Block quartz_stairs;
+ public static Block activator_rail;
+ public static Block dropper;
+ public static Block stained_hardened_clay;
+ public static Block barrier;
+ public static Block iron_trapdoor;
+ public static Block hay_block;
+ public static Block carpet;
+ public static Block hardened_clay;
+ public static Block coal_block;
+ public static Block packed_ice;
+ public static Block acacia_stairs;
+ public static Block dark_oak_stairs;
+ public static Block slime_block;
+ public static BlockDoublePlant double_plant;
+ public static BlockStainedGlass stained_glass;
+ public static BlockStainedGlassPane stained_glass_pane;
+ public static Block prismarine;
+ public static Block sea_lantern;
+ public static Block standing_banner;
+ public static Block wall_banner;
+ public static Block red_sandstone;
+ public static Block red_sandstone_stairs;
+ public static BlockSlab double_stone_slab2;
+ public static BlockSlab stone_slab2;
+
> CHANGE 4 : 16 @ 4 : 5
~ public static ModData makeModData() {
~ ModData data = new ModData();
~ Map<ResourceLocation, Block> blockMap = Block.blockRegistry.registryObjects;
~ for (Map.Entry<ResourceLocation, Block> entry : blockMap.entrySet()) {
~ if (entry.getKey().resourceName != null && entry.getValue() != null) {
~ data.set(entry.getKey().resourceName, entry.getValue().makeModData());
~ }
~ }
~ return data;
~ }
~
~ static void doBootstrap() {
> EOF

View File

@ -5,200 +5,219 @@
# Version: 1.0
# Author: lax1dude
> DELETE 2 @ 2 : 3
> CHANGE 2 : 3 @ 2 : 3
> CHANGE 13 : 200 @ 13 : 200
~ import net.eaglerforge.api.ModData;
~ public static Item iron_shovel;
~ public static Item iron_pickaxe;
~ public static Item iron_axe;
~ public static Item flint_and_steel;
~ public static Item apple;
~ public static ItemBow bow;
~ public static Item arrow;
~ public static Item coal;
~ public static Item diamond;
~ public static Item iron_ingot;
~ public static Item gold_ingot;
~ public static Item iron_sword;
~ public static Item wooden_sword;
~ public static Item wooden_shovel;
~ public static Item wooden_pickaxe;
~ public static Item wooden_axe;
~ public static Item stone_sword;
~ public static Item stone_shovel;
~ public static Item stone_pickaxe;
~ public static Item stone_axe;
~ public static Item diamond_sword;
~ public static Item diamond_shovel;
~ public static Item diamond_pickaxe;
~ public static Item diamond_axe;
~ public static Item stick;
~ public static Item bowl;
~ public static Item mushroom_stew;
~ public static Item golden_sword;
~ public static Item golden_shovel;
~ public static Item golden_pickaxe;
~ public static Item golden_axe;
~ public static Item string;
~ public static Item feather;
~ public static Item gunpowder;
~ public static Item wooden_hoe;
~ public static Item stone_hoe;
~ public static Item iron_hoe;
~ public static Item diamond_hoe;
~ public static Item golden_hoe;
~ public static Item wheat_seeds;
~ public static Item wheat;
~ public static Item bread;
~ public static ItemArmor leather_helmet;
~ public static ItemArmor leather_chestplate;
~ public static ItemArmor leather_leggings;
~ public static ItemArmor leather_boots;
~ public static ItemArmor chainmail_helmet;
~ public static ItemArmor chainmail_chestplate;
~ public static ItemArmor chainmail_leggings;
~ public static ItemArmor chainmail_boots;
~ public static ItemArmor iron_helmet;
~ public static ItemArmor iron_chestplate;
~ public static ItemArmor iron_leggings;
~ public static ItemArmor iron_boots;
~ public static ItemArmor diamond_helmet;
~ public static ItemArmor diamond_chestplate;
~ public static ItemArmor diamond_leggings;
~ public static ItemArmor diamond_boots;
~ public static ItemArmor golden_helmet;
~ public static ItemArmor golden_chestplate;
~ public static ItemArmor golden_leggings;
~ public static ItemArmor golden_boots;
~ public static Item flint;
~ public static Item porkchop;
~ public static Item cooked_porkchop;
~ public static Item painting;
~ public static Item golden_apple;
~ public static Item sign;
~ public static Item oak_door;
~ public static Item spruce_door;
~ public static Item birch_door;
~ public static Item jungle_door;
~ public static Item acacia_door;
~ public static Item dark_oak_door;
~ public static Item bucket;
~ public static Item water_bucket;
~ public static Item lava_bucket;
~ public static Item minecart;
~ public static Item saddle;
~ public static Item iron_door;
~ public static Item redstone;
~ public static Item snowball;
~ public static Item boat;
~ public static Item leather;
~ public static Item milk_bucket;
~ public static Item brick;
~ public static Item clay_ball;
~ public static Item reeds;
~ public static Item paper;
~ public static Item book;
~ public static Item slime_ball;
~ public static Item chest_minecart;
~ public static Item furnace_minecart;
~ public static Item egg;
~ public static Item compass;
~ public static ItemFishingRod fishing_rod;
~ public static Item clock;
~ public static Item glowstone_dust;
~ public static Item fish;
~ public static Item cooked_fish;
~ public static Item dye;
~ public static Item bone;
~ public static Item sugar;
~ public static Item cake;
~ public static Item bed;
~ public static Item repeater;
~ public static Item cookie;
~ public static ItemMap filled_map;
~ public static ItemShears shears;
~ public static Item melon;
~ public static Item pumpkin_seeds;
~ public static Item melon_seeds;
~ public static Item beef;
~ public static Item cooked_beef;
~ public static Item chicken;
~ public static Item cooked_chicken;
~ public static Item mutton;
~ public static Item cooked_mutton;
~ public static Item rabbit;
~ public static Item cooked_rabbit;
~ public static Item rabbit_stew;
~ public static Item rabbit_foot;
~ public static Item rabbit_hide;
~ public static Item rotten_flesh;
~ public static Item ender_pearl;
~ public static Item blaze_rod;
~ public static Item ghast_tear;
~ public static Item gold_nugget;
~ public static Item nether_wart;
~ public static ItemPotion potionitem;
~ public static Item glass_bottle;
~ public static Item spider_eye;
~ public static Item fermented_spider_eye;
~ public static Item blaze_powder;
~ public static Item magma_cream;
~ public static Item brewing_stand;
~ public static Item cauldron;
~ public static Item ender_eye;
~ public static Item speckled_melon;
~ public static Item spawn_egg;
~ public static Item experience_bottle;
~ public static Item fire_charge;
~ public static Item writable_book;
~ public static Item written_book;
~ public static Item emerald;
~ public static Item item_frame;
~ public static Item flower_pot;
~ public static Item carrot;
~ public static Item potato;
~ public static Item baked_potato;
~ public static Item poisonous_potato;
~ public static ItemEmptyMap map;
~ public static Item golden_carrot;
~ public static Item skull;
~ public static Item carrot_on_a_stick;
~ public static Item nether_star;
~ public static Item pumpkin_pie;
~ public static Item fireworks;
~ public static Item firework_charge;
~ public static ItemEnchantedBook enchanted_book;
~ public static Item comparator;
~ public static Item netherbrick;
~ public static Item quartz;
~ public static Item tnt_minecart;
~ public static Item hopper_minecart;
~ public static ItemArmorStand armor_stand;
~ public static Item iron_horse_armor;
~ public static Item golden_horse_armor;
~ public static Item diamond_horse_armor;
~ public static Item lead;
~ public static Item name_tag;
~ public static Item command_block_minecart;
~ public static Item record_13;
~ public static Item record_cat;
~ public static Item record_blocks;
~ public static Item record_chirp;
~ public static Item record_far;
~ public static Item record_mall;
~ public static Item record_mellohi;
~ public static Item record_stal;
~ public static Item record_strad;
~ public static Item record_ward;
~ public static Item record_11;
~ public static Item record_wait;
~ public static Item prismarine_shard;
~ public static Item prismarine_crystals;
~ public static Item banner;
> CHANGE 12 : 13 @ 12 : 200
> CHANGE 5 : 6 @ 5 : 6
~ import java.util.Map;
> INSERT 1 : 190 @ 1
+ public class Items extends ModData {
+ public static Item iron_shovel;
+ public static Item iron_pickaxe;
+ public static Item iron_axe;
+ public static Item flint_and_steel;
+ public static Item apple;
+ public static ItemBow bow;
+ public static Item arrow;
+ public static Item coal;
+ public static Item diamond;
+ public static Item iron_ingot;
+ public static Item gold_ingot;
+ public static Item iron_sword;
+ public static Item wooden_sword;
+ public static Item wooden_shovel;
+ public static Item wooden_pickaxe;
+ public static Item wooden_axe;
+ public static Item stone_sword;
+ public static Item stone_shovel;
+ public static Item stone_pickaxe;
+ public static Item stone_axe;
+ public static Item diamond_sword;
+ public static Item diamond_shovel;
+ public static Item diamond_pickaxe;
+ public static Item diamond_axe;
+ public static Item stick;
+ public static Item bowl;
+ public static Item mushroom_stew;
+ public static Item golden_sword;
+ public static Item golden_shovel;
+ public static Item golden_pickaxe;
+ public static Item golden_axe;
+ public static Item string;
+ public static Item feather;
+ public static Item gunpowder;
+ public static Item wooden_hoe;
+ public static Item stone_hoe;
+ public static Item iron_hoe;
+ public static Item diamond_hoe;
+ public static Item golden_hoe;
+ public static Item wheat_seeds;
+ public static Item wheat;
+ public static Item bread;
+ public static ItemArmor leather_helmet;
+ public static ItemArmor leather_chestplate;
+ public static ItemArmor leather_leggings;
+ public static ItemArmor leather_boots;
+ public static ItemArmor chainmail_helmet;
+ public static ItemArmor chainmail_chestplate;
+ public static ItemArmor chainmail_leggings;
+ public static ItemArmor chainmail_boots;
+ public static ItemArmor iron_helmet;
+ public static ItemArmor iron_chestplate;
+ public static ItemArmor iron_leggings;
+ public static ItemArmor iron_boots;
+ public static ItemArmor diamond_helmet;
+ public static ItemArmor diamond_chestplate;
+ public static ItemArmor diamond_leggings;
+ public static ItemArmor diamond_boots;
+ public static ItemArmor golden_helmet;
+ public static ItemArmor golden_chestplate;
+ public static ItemArmor golden_leggings;
+ public static ItemArmor golden_boots;
+ public static Item flint;
+ public static Item porkchop;
+ public static Item cooked_porkchop;
+ public static Item painting;
+ public static Item golden_apple;
+ public static Item sign;
+ public static Item oak_door;
+ public static Item spruce_door;
+ public static Item birch_door;
+ public static Item jungle_door;
+ public static Item acacia_door;
+ public static Item dark_oak_door;
+ public static Item bucket;
+ public static Item water_bucket;
+ public static Item lava_bucket;
+ public static Item minecart;
+ public static Item saddle;
+ public static Item iron_door;
+ public static Item redstone;
+ public static Item snowball;
+ public static Item boat;
+ public static Item leather;
+ public static Item milk_bucket;
+ public static Item brick;
+ public static Item clay_ball;
+ public static Item reeds;
+ public static Item paper;
+ public static Item book;
+ public static Item slime_ball;
+ public static Item chest_minecart;
+ public static Item furnace_minecart;
+ public static Item egg;
+ public static Item compass;
+ public static ItemFishingRod fishing_rod;
+ public static Item clock;
+ public static Item glowstone_dust;
+ public static Item fish;
+ public static Item cooked_fish;
+ public static Item dye;
+ public static Item bone;
+ public static Item sugar;
+ public static Item cake;
+ public static Item bed;
+ public static Item repeater;
+ public static Item cookie;
+ public static ItemMap filled_map;
+ public static ItemShears shears;
+ public static Item melon;
+ public static Item pumpkin_seeds;
+ public static Item melon_seeds;
+ public static Item beef;
+ public static Item cooked_beef;
+ public static Item chicken;
+ public static Item cooked_chicken;
+ public static Item mutton;
+ public static Item cooked_mutton;
+ public static Item rabbit;
+ public static Item cooked_rabbit;
+ public static Item rabbit_stew;
+ public static Item rabbit_foot;
+ public static Item rabbit_hide;
+ public static Item rotten_flesh;
+ public static Item ender_pearl;
+ public static Item blaze_rod;
+ public static Item ghast_tear;
+ public static Item gold_nugget;
+ public static Item nether_wart;
+ public static ItemPotion potionitem;
+ public static Item glass_bottle;
+ public static Item spider_eye;
+ public static Item fermented_spider_eye;
+ public static Item blaze_powder;
+ public static Item magma_cream;
+ public static Item brewing_stand;
+ public static Item cauldron;
+ public static Item ender_eye;
+ public static Item speckled_melon;
+ public static Item spawn_egg;
+ public static Item experience_bottle;
+ public static Item fire_charge;
+ public static Item writable_book;
+ public static Item written_book;
+ public static Item emerald;
+ public static Item item_frame;
+ public static Item flower_pot;
+ public static Item carrot;
+ public static Item potato;
+ public static Item baked_potato;
+ public static Item poisonous_potato;
+ public static ItemEmptyMap map;
+ public static Item golden_carrot;
+ public static Item skull;
+ public static Item carrot_on_a_stick;
+ public static Item nether_star;
+ public static Item pumpkin_pie;
+ public static Item fireworks;
+ public static Item firework_charge;
+ public static ItemEnchantedBook enchanted_book;
+ public static Item comparator;
+ public static Item netherbrick;
+ public static Item quartz;
+ public static Item tnt_minecart;
+ public static Item hopper_minecart;
+ public static ItemArmorStand armor_stand;
+ public static Item iron_horse_armor;
+ public static Item golden_horse_armor;
+ public static Item diamond_horse_armor;
+ public static Item lead;
+ public static Item name_tag;
+ public static Item command_block_minecart;
+ public static Item record_13;
+ public static Item record_cat;
+ public static Item record_blocks;
+ public static Item record_chirp;
+ public static Item record_far;
+ public static Item record_mall;
+ public static Item record_mellohi;
+ public static Item record_stal;
+ public static Item record_strad;
+ public static Item record_ward;
+ public static Item record_11;
+ public static Item record_wait;
+ public static Item prismarine_shard;
+ public static Item prismarine_crystals;
+ public static Item banner;
+
> CHANGE 4 : 16 @ 4 : 5
~ public static ModData makeModData() {
~ ModData data = new ModData();
~ Map<ResourceLocation, Item> itemMap = Item.itemRegistry.registryObjects;
~ for (Map.Entry<ResourceLocation, Item> entry : itemMap.entrySet()) {
~ if (entry.getKey().resourceName != null && entry.getValue() != null) {
~ data.set(entry.getKey().resourceName, entry.getValue().makeModData());
~ }
~ }
~ return data;
~ }
~
~ static void doBootstrap() {
> EOF

View File

@ -7,17 +7,71 @@
> DELETE 2 @ 2 : 4
> INSERT 3 : 7 @ 3
> INSERT 3 : 9 @ 3
+
+ import com.google.common.collect.Lists;
+ import com.google.common.collect.Sets;
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
> DELETE 2 @ 2 : 5
> CHANGE 19 : 20 @ 19 : 20
> CHANGE 5 : 6 @ 5 : 6
~ public abstract class Container extends ModData {
> INSERT 1 : 42 @ 1
+
+ public void loadModData(BaseData data) {
+ BaseData[] parItemStacks = data.getBaseDataArr("inventoryItemStacks");
+ for (int i = 0; i < parItemStacks.length && i < inventoryItemStacks.size(); i++) {
+ if (inventoryItemStacks.get(i) != null) {
+ inventoryItemStacks.get(i).loadModData(parItemStacks[i]);
+ } else if (parItemStacks[i] != null && parItemStacks[i].getRef() instanceof ItemStack) {
+ inventoryItemStacks.set(i, (ItemStack) parItemStacks[i].getRef());
+ }
+ }
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ ModData[] parBaseDatas = new ModData[inventoryItemStacks.size()];
+ for (int i = 0; i < inventoryItemStacks.size(); i++) {
+ if (inventoryItemStacks.get(i) != null) {
+ parBaseDatas[i] = inventoryItemStacks.get(i).makeModData();
+ }
+ }
+ data.set("inventoryItemStacks", parBaseDatas);
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.setCallbackObjectArr("getPlayerList", () -> {
+ ModData[] parPlayerList = new ModData[playerList.size()];
+ int i = 0;
+ for (EntityPlayer player : playerList) {
+ if (player != null) {
+ parPlayerList[i] = player.makeModData();
+ }
+ i++;
+ }
+ return parPlayerList;
+ });
+ return data;
+ }
+
> CHANGE 12 : 13 @ 12 : 13
~ this.inventoryItemStacks.add((ItemStack) null);
> INSERT 521 : 522 @ 521
+
> EOF

View File

@ -5,10 +5,13 @@
# Version: 1.0
# Author: lax1dude
> INSERT 2 : 7 @ 2
> INSERT 2 : 10 @ 2
+ import java.util.List;
+ import java.util.Map;
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
+ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
+ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
+
@ -19,7 +22,11 @@
> DELETE 23 @ 23 : 91
> CHANGE 16 : 18 @ 16 : 17
> CHANGE 13 : 14 @ 13 : 14
~ public class Item extends ModData {
> CHANGE 2 : 4 @ 2 : 3
~ protected static final EaglercraftUUID itemModifierUUID = EaglercraftUUID
~ .fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
@ -28,4 +35,51 @@
~ protected static EaglercraftRandom itemRand = new EaglercraftRandom();
> INSERT 20 : 64 @ 20
+ public void loadModData(BaseData data) {
+ maxStackSize = data.getInt("maxStackSize");
+ maxDamage = data.getInt("maxDamage");
+ bFull3D = data.getBoolean("bFull3D");
+ hasSubtypes = data.getBoolean("hasSubtypes");
+ potionEffect = data.getString("potionEffect");
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("potionEffect", potionEffect);
+ data.set("unlocalizedName", unlocalizedName);
+ data.set("hasSubtypes", hasSubtypes);
+ data.set("bFull3D", bFull3D);
+ data.set("maxDamage", maxDamage);
+ data.set("maxStackSize", maxStackSize);
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ data.setCallbackInt("getID", () -> {
+ return getIdFromItem(this);
+ });
+ data.setCallbackObjectWithDataArg("setMaxStackSize", (BaseData params) -> {
+ return setMaxStackSize(params.getInt("maxStackSize")).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("setHasSubtypes", (BaseData params) -> {
+ return setHasSubtypes(params.getBoolean("hasSubtypes")).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("setMaxDamage", (BaseData params) -> {
+ return setMaxDamage(params.getInt("maxDamageIn")).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("setUnlocalizedName", (BaseData params) -> {
+ return setUnlocalizedName(params.getString("s")).makeModData();
+ });
+ data.setCallbackObjectWithDataArg("setPotionEffect", (BaseData params) -> {
+ return setPotionEffect(params.getString("potionEffect")).makeModData();
+ });
+ return data;
+ }
+
> EOF

View File

@ -9,8 +9,11 @@
> DELETE 3 @ 3 : 4
> INSERT 1 : 9 @ 1
> INSERT 1 : 12 @ 1
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
+ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
+ import net.lax1dude.eaglercraft.v1_8.HString;
+ import java.util.Set;
@ -20,13 +23,229 @@
+ import com.google.common.collect.Multimap;
+
> DELETE 13 @ 13 : 17
> CHANGE 13 : 14 @ 13 : 20
> CHANGE 185 : 186 @ 185 : 186
~ import net.minecraft.nbt.*;
> CHANGE 10 : 11 @ 10 : 11
~ public final class ItemStack extends ModData {
> INSERT 16 : 168 @ 16
+ public void loadModData(BaseData data) {
+ stackSize = data.getInt("amount");
+ animationsToGo = data.getInt("animationsToGo");
+ itemDamage = data.getInt("itemDamage");
+ if (itemFrame != null) {
+ itemFrame.loadModData(data.getBaseData("itemFrame"));
+ }
+ if (canDestroyCacheBlock != null) {
+ canDestroyCacheBlock.loadModData(data.getBaseData("canDestroyCacheBlock"));
+ }
+ if (canPlaceOnCacheBlock != null) {
+ canPlaceOnCacheBlock.loadModData(data.getBaseData("canPlaceOnCacheBlock"));
+ }
+ canDestroyCacheResult = data.getBoolean("canDestroyCacheResult");
+ canPlaceOnCacheResult = data.getBoolean("canPlaceOnCacheResult");
+ }
+
+ public static ItemStack fromModData(BaseData data) {
+ return new ItemStack(Item.getItemById(data.getInt("itemId")), data.getInt("amount"), data.getInt("itemDamage"));
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.set("amount", stackSize);
+ data.set("animationsToGo", animationsToGo);
+ data.set("itemId", item.getIdFromItem(item));
+ data.set("itemDamage", itemDamage);
+ if (itemFrame != null) {
+ data.set("itemFrame", itemFrame.makeModData());
+ }
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ if (canDestroyCacheBlock != null) {
+ data.set("canDestroyCacheBlock", canDestroyCacheBlock.makeModData());
+ }
+ data.set("canDestroyCacheResult", canDestroyCacheResult);
+ if (canPlaceOnCacheBlock != null) {
+ data.set("canPlaceOnCacheBlock", canPlaceOnCacheBlock.makeModData());
+ }
+ data.set("canPlaceOnCacheResult", canPlaceOnCacheResult);
+
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.setCallbackObject("getItem", () -> {
+ return getItem().makeModData();
+ });
+ data.setCallbackInt("getMaxStackSize", () -> {
+ return getMaxStackSize();
+ });
+ data.setCallbackBoolean("isStackable", () -> {
+ return isStackable();
+ });
+ data.setCallbackBoolean("isItemStackDamageable", () -> {
+ return isItemStackDamageable();
+ });
+ data.setCallbackBoolean("getHasSubtypes", () -> {
+ return getHasSubtypes();
+ });
+ data.setCallbackBoolean("isItemDamaged", () -> {
+ return isItemDamaged();
+ });
+ data.setCallbackInt("getItemDamage", () -> {
+ return getItemDamage();
+ });
+ data.setCallbackInt("getMetadata", () -> {
+ return getMetadata();
+ });
+ data.setCallbackVoidWithDataArg("setItemDamage", (BaseData params) -> {
+ setItemDamage(params.getInt("meta"));
+ });
+ data.setCallbackInt("getMaxDamage", () -> {
+ return getMaxDamage();
+ });
+ data.setCallbackObject("copy", () -> {
+ return copy().makeModData();
+ });
+ data.setCallbackString("getUnlocalizedName", () -> {
+ return getUnlocalizedName();
+ });
+ data.setCallbackString("toString", () -> {
+ return toString();
+ });
+ data.setCallbackInt("getMaxItemUseDuration", () -> {
+ return getMaxItemUseDuration();
+ });
+ data.setCallbackString("getDisplayName", () -> {
+ return getDisplayName();
+ });
+ data.setCallbackObjectWithDataArg("setDisplayName", (BaseData params) -> {
+ return setStackDisplayName(params.getString("displayName")).makeModData();
+ });
+ data.setCallbackVoid("clearCustomName", () -> {
+ clearCustomName();
+ });
+ data.setCallbackBoolean("hasDisplayName", () -> {
+ return hasDisplayName();
+ });
+ data.setCallbackBoolean("hasEffect", () -> {
+ return hasEffect();
+ });
+ data.setCallbackBoolean("isItemEnchantable", () -> {
+ return isItemEnchantable();
+ });
+ data.setCallbackVoidWithDataArg("addEnchantment", (BaseData params) -> {
+ if (params.getBaseData("ench") instanceof Enchantment) {
+ addEnchantment((Enchantment) params.getBaseData("ench"), params.getInt("level"));
+ }
+ });
+ data.setCallbackBoolean("isItemEnchanted", () -> {
+ return isItemEnchanted();
+ });
+ data.setCallbackBoolean("canEditBlocks", () -> {
+ return canEditBlocks();
+ });
+ data.setCallbackBoolean("isOnItemFrame", () -> {
+ return isOnItemFrame();
+ });
+ data.setCallbackInt("getRepairCost", () -> {
+ return getRepairCost();
+ });
+ data.setCallbackVoidWithDataArg("setRepairCost", (BaseData params) -> {
+ setRepairCost(params.getInt("cost"));
+ });
+ data.setCallbackVoidWithDataArg("setItem", (BaseData params) -> {
+ if (params.getBaseData("newItem") instanceof Item) {
+ setItem((Item) params.getBaseData("newItem"));
+ }
+ });
+ data.setCallbackBooleanWithDataArg("canDestroy", (BaseData params) -> {
+ return canDestroy(Block.getBlockById(params.getInt("blockId")));
+ });
+ data.setCallbackBooleanWithDataArg("canPlaceOn", (BaseData params) -> {
+ return canPlaceOn(Block.getBlockById(params.getInt("blockId")));
+ });
+ data.setCallbackString("toNBT", () -> {
+ return toNBT();
+ });
+ data.setCallbackVoidWithDataArg("fromNBT", (BaseData params) -> {
+ fromNBT(params.getString("nbt"));
+ });
+ data.setCallbackStringArr("getLore", () -> {
+ return getLore();
+ });
+ data.setCallbackVoidWithDataArg("setLore", (BaseData params) -> {
+ setLore(params.getStringArr("lore"));
+ });
+
+ return data;
+ }
+
> INSERT 91 : 106 @ 91
+ public String toNBT() {
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt = writeToNBT(nbt);
+ return nbt.toString();
+ }
+
+ public void fromNBT(String nbt) {
+ try {
+ NBTTagCompound nbtParsed = JsonToNBT.getTagFromJson(nbt);
+ this.readFromNBT(nbtParsed);
+ } catch (Exception e) {
+ // Swallowing the error!
+ }
+ }
+
> CHANGE 64 : 65 @ 64 : 65
~ public boolean attemptDamageItem(int amount, EaglercraftRandom rand) {
> CHANGE 249 : 250 @ 249 : 250
> INSERT 210 : 244 @ 210
+ public void setLore(String[] loreIn) {
+ if (this.stackTagCompound == null) {
+ this.stackTagCompound = new NBTTagCompound();
+ }
+ if (!this.stackTagCompound.hasKey("display", 10)) {
+ this.stackTagCompound.setTag("display", new NBTTagCompound());
+ }
+ NBTTagCompound display = this.stackTagCompound.getCompoundTag("display");
+ NBTTagList lore = new NBTTagList();
+ for (String strIn : loreIn) {
+ lore.appendTag(new NBTTagString(strIn));
+ }
+ display.setTag("Lore", lore);
+ }
+
+ public String[] getLore() {
+ if (this.stackTagCompound == null) {
+ return new String[0];
+ }
+ if (!this.stackTagCompound.hasKey("display", 10)) {
+ return new String[0];
+ }
+ NBTTagCompound display = this.stackTagCompound.getCompoundTag("display");
+ if (!display.hasKey("Lore", 9)) {
+ return new String[0];
+ }
+ NBTTagList lore = (NBTTagList) display.getTag("Lore");
+ String[] outStrArr = new String[lore.tagCount()];
+ for (int i = 0; i < outStrArr.length; i++) {
+ outStrArr[i] = lore.getStringTagAt(i);
+ }
+ return outStrArr;
+ }
+
> CHANGE 39 : 40 @ 39 : 40
~ s = s + HString.format("#%04d/%d%s",

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int key;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public String message;
> EOF

View File

@ -9,4 +9,23 @@
+
> CHANGE 8 : 11 @ 8 : 11
~ public int entityId;
~ public C02PacketUseEntity.Action action;
~ public Vec3 hitVec;
> INSERT 14 : 24 @ 14
+ public C02PacketUseEntity(int entityIdentifier, C02PacketUseEntity.Action action) {
+ this.entityId = entityIdentifier;
+ this.action = action;
+ }
+
+ public C02PacketUseEntity(int entityIdentifier, Vec3 hitVec) {
+ this(entityIdentifier, C02PacketUseEntity.Action.INTERACT_AT);
+ this.hitVec = hitVec;
+ }
+
> EOF

View File

@ -9,4 +9,15 @@
+
> CHANGE 5 : 13 @ 5 : 13
~ public double x;
~ public double y;
~ public double z;
~ public float yaw;
~ public float pitch;
~ public boolean onGround;
~ public boolean moving;
~ public boolean rotating;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 7 : 10 @ 7 : 10
~ public BlockPos position;
~ public EnumFacing facing;
~ public C07PacketPlayerDigging.Action status;
> EOF

View File

@ -9,4 +9,13 @@
+
> CHANGE 8 : 14 @ 8 : 14
~ public BlockPos position;
~ public int placedBlockDirection;
~ public ItemStack stack;
~ public float facingX;
~ public float facingY;
~ public float facingZ;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int slotId;
> EOF

View File

@ -9,4 +9,19 @@
+
> CHANGE 6 : 9 @ 6 : 9
~ public int entityID;
~ public C0BPacketEntityAction.Action action;
~ public int auxData;
> INSERT 14 : 20 @ 14
+ public C0BPacketEntityAction(int entityId, C0BPacketEntityAction.Action action, int auxData) {
+ this.entityID = entityId;
+ this.action = action;
+ this.auxData = auxData;
+ }
+
> EOF

View File

@ -9,4 +9,11 @@
+
> CHANGE 5 : 9 @ 5 : 9
~ public float strafeSpeed;
~ public float forwardSpeed;
~ public boolean jumping;
~ public boolean sneaking;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int windowId;
> EOF

View File

@ -9,4 +9,13 @@
+
> CHANGE 6 : 12 @ 6 : 12
~ public int windowId;
~ public int slotId;
~ public int usedButton;
~ public short actionNumber;
~ public ItemStack clickedItem;
~ public int mode;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 5 : 8 @ 5 : 8
~ public int windowId;
~ public short uid;
~ public boolean accepted;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public int slotId;
~ public ItemStack stack;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 5 : 7 @ 5 : 7
~ public int windowId;
~ public int button;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 7 : 9 @ 7 : 9
~ public BlockPos pos;
~ public IChatComponent[] lines;
> EOF

View File

@ -9,4 +9,13 @@
+
> CHANGE 6 : 12 @ 6 : 12
~ public boolean invulnerable;
~ public boolean flying;
~ public boolean allowFlying;
~ public boolean creativeMode;
~ public float flySpeed;
~ public float walkSpeed;
> EOF

View File

@ -13,4 +13,9 @@
> DELETE 4 @ 4 : 5
> CHANGE 2 : 4 @ 2 : 4
~ public String message;
~ public BlockPos targetBlock;
> EOF

View File

@ -5,7 +5,15 @@
# Version: 1.0
# Author: lax1dude
> INSERT 62 : 66 @ 62
> CHANGE 9 : 14 @ 9 : 14
~ public String lang;
~ public int view;
~ public EntityPlayer.EnumChatVisibility chatVisibility;
~ public boolean enableColors;
~ public int modelPartFlags;
> INSERT 48 : 52 @ 48
+
+ public int getViewDistance() {

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public C16PacketClientStatus.EnumState status;
> EOF

View File

@ -12,4 +12,8 @@
+
+ import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf;
> CHANGE 5 : 6 @ 5 : 6
~ public String channel;
> EOF

View File

@ -11,7 +11,7 @@
> CHANGE 7 : 8 @ 7 : 8
~ private EaglercraftUUID id;
~ public EaglercraftUUID id;
> CHANGE 4 : 5 @ 4 : 5

View File

@ -9,4 +9,9 @@
+
> CHANGE 5 : 7 @ 5 : 7
~ public String hash;
~ public C19PacketResourcePackStatus.Action status;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int id;
> EOF

View File

@ -9,4 +9,17 @@
+
> CHANGE 8 : 10 @ 8 : 10
~ public int entityId;
~ public boolean hardcoreMode;
> CHANGE 1 : 2 @ 1 : 2
~ public int dimension;
> CHANGE 1 : 2 @ 1 : 2
~ public int maxPlayers;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public IChatComponent chatComponent;
~ public byte type;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 5 : 7 @ 5 : 7
~ public long totalWorldTime;
~ public long worldTime;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 6 : 9 @ 6 : 9
~ public int entityID;
~ public int equipmentSlot;
~ public ItemStack itemStack;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 6 : 7 @ 6 : 7
~ public BlockPos spawnBlockPos;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 5 : 8 @ 5 : 8
~ public float health;
~ public int foodLevel;
~ public float saturationLevel;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 8 : 11 @ 8 : 11
~ public int dimensionID;
~ public EnumDifficulty difficulty;
~ public WorldSettings.GameType gameType;
> EOF

View File

@ -9,4 +9,12 @@
+
> CHANGE 5 : 10 @ 5 : 10
~ public double x;
~ public double y;
~ public double z;
~ public float yaw;
~ public float pitch;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int heldItemHotbarIndex;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 8 : 10 @ 8 : 10
~ public int playerID;
~ public BlockPos bedPos;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public int entityId;
~ public int type;
> EOF

View File

@ -10,11 +10,18 @@
~ import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
~
> CHANGE 11 : 12 @ 11 : 12
> CHANGE 10 : 18 @ 10 : 18
~ private EaglercraftUUID playerId;
~ public int entityId;
~ public EaglercraftUUID playerId;
~ public int x;
~ public int y;
~ public int z;
~ public byte yaw;
~ public byte pitch;
~ public int currentItem;
> CHANGE 65 : 66 @ 65 : 66
> CHANGE 59 : 60 @ 59 : 60
~ public EaglercraftUUID getPlayer() {

View File

@ -9,4 +9,9 @@
+
> CHANGE 5 : 7 @ 5 : 7
~ public int collectedItemEntityId;
~ public int entityId;
> EOF

View File

@ -9,4 +9,17 @@
+
> CHANGE 7 : 17 @ 7 : 17
~ public int entityId;
~ public int x;
~ public int y;
~ public int z;
~ public int speedX;
~ public int speedY;
~ public int speedZ;
~ public int pitch;
~ public int yaw;
~ public int type;
> EOF

View File

@ -9,4 +9,18 @@
+
> CHANGE 9 : 20 @ 9 : 20
~ public int entityId;
~ public int type;
~ public int x;
~ public int y;
~ public int z;
~ public int velocityX;
~ public int velocityY;
~ public int velocityZ;
~ public byte yaw;
~ public byte pitch;
~ public byte headPitch;
> EOF

View File

@ -9,4 +9,13 @@
+
> CHANGE 8 : 10 @ 8 : 10
~ public int entityID;
~ public BlockPos position;
> CHANGE 1 : 2 @ 1 : 2
~ public String title;
> EOF

View File

@ -9,4 +9,12 @@
+
> CHANGE 7 : 12 @ 7 : 12
~ public int entityID;
~ public int posX;
~ public int posY;
~ public int posZ;
~ public int xpValue;
> EOF

View File

@ -9,4 +9,11 @@
+
> CHANGE 6 : 10 @ 6 : 10
~ public int entityID;
~ public int motionX;
~ public int motionY;
~ public int motionZ;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int[] entityIDs;
> EOF

View File

@ -9,4 +9,14 @@
+
> CHANGE 7 : 14 @ 7 : 14
~ public int entityId;
~ public byte posX;
~ public byte posY;
~ public byte posZ;
~ public byte yaw;
~ public byte pitch;
~ public boolean onGround;
> EOF

View File

@ -9,4 +9,14 @@
+
> CHANGE 7 : 14 @ 7 : 14
~ public int entityId;
~ public int posX;
~ public int posY;
~ public int posZ;
~ public byte yaw;
~ public byte pitch;
~ public boolean onGround;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 7 : 9 @ 7 : 9
~ public int entityId;
~ public byte yaw;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 7 : 9 @ 7 : 9
~ public int entityId;
~ public byte logicOpcode;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 6 : 9 @ 6 : 9
~ public int leash;
~ public int entityId;
~ public int vehicleEntityId;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 6 : 7 @ 6 : 7
~ public int entityId;
> EOF

View File

@ -9,4 +9,12 @@
+
> CHANGE 6 : 11 @ 6 : 11
~ public int entityId;
~ public byte effectId;
~ public byte amplifier;
~ public int duration;
~ public byte hideParticles;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public int entityId;
~ public int effectId;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public int totalExperience;
~ public int level;
> EOF

View File

@ -14,7 +14,11 @@
~ import com.google.common.collect.Lists;
~
> CHANGE 35 : 36 @ 35 : 36
> CHANGE 7 : 8 @ 7 : 8
~ public int entityId;
> CHANGE 27 : 28 @ 27 : 28
~ EaglercraftUUID uuid = parPacketBuffer.readUuid();

View File

@ -7,13 +7,21 @@
> DELETE 2 @ 2 : 3
> INSERT 2 : 5 @ 2
> INSERT 2 : 7 @ 2
+
+ import com.google.common.collect.Lists;
+
+ import net.eaglerforge.api.BaseData;
+ import net.eaglerforge.api.ModData;
> CHANGE 74 : 75 @ 74 : 75
> CHANGE 7 : 10 @ 7 : 10
~ public int chunkX;
~ public int chunkZ;
~ public S21PacketChunkData.Extracted extractedData;
> CHANGE 64 : 65 @ 64 : 65
~ for (ExtendedBlockStorage extendedblockstorage1 : (ArrayList<ExtendedBlockStorage>) arraylist) {
@ -25,4 +33,29 @@
~ for (ExtendedBlockStorage extendedblockstorage3 : (ArrayList<ExtendedBlockStorage>) arraylist) {
> CHANGE 33 : 34 @ 33 : 34
~ public static class Extracted extends ModData {
> INSERT 2 : 20 @ 2
+
+ public ModData makeModData() {
+ ModData d = new ModData();
+ d.setCallbackVoid("reload", () -> {
+ loadModData(d);
+ });
+ d.set("data", data);
+ d.set("dataSize", dataSize);
+ d.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ return d;
+ }
+
+ public void loadModData(BaseData d) {
+ data = d.getByteArr("data");
+ dataSize = d.getInt("dataSize");
+ }
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 9 : 10 @ 9 : 10
~ public BlockPos blockPosition;
> EOF

View File

@ -9,4 +9,11 @@
+
> CHANGE 7 : 11 @ 7 : 11
~ public BlockPos blockPosition;
~ public int instrument;
~ public int pitch;
~ public Block block;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 6 : 9 @ 6 : 9
~ public int breakerId;
~ public BlockPos position;
~ public int progress;
> EOF

View File

@ -11,4 +11,11 @@
> DELETE 3 @ 3 : 4
> CHANGE 3 : 7 @ 3 : 7
~ public int[] xPositions;
~ public int[] zPositions;
~ public S21PacketChunkData.Extracted[] chunksData;
~ public boolean isOverworld;
> EOF

View File

@ -13,4 +13,11 @@
+ import com.google.common.collect.Lists;
+
> CHANGE 7 : 11 @ 7 : 11
~ public double posX;
~ public double posY;
~ public double posZ;
~ public float strength;
> EOF

View File

@ -9,4 +9,11 @@
+
> CHANGE 6 : 10 @ 6 : 10
~ public int soundType;
~ public BlockPos soundPos;
~ public int soundData;
~ public boolean serverWide;
> EOF

View File

@ -13,4 +13,13 @@
> DELETE 4 @ 4 : 5
> CHANGE 2 : 8 @ 2 : 8
~ public String soundName;
~ public int posX;
~ public int posY = Integer.MAX_VALUE;
~ public int posZ;
~ public float soundVolume;
~ public int soundPitch;
> EOF

View File

@ -9,4 +9,18 @@
+
> CHANGE 6 : 17 @ 6 : 17
~ public EnumParticleTypes particleType;
~ public float xCoord;
~ public float yCoord;
~ public float zCoord;
~ public float xOffset;
~ public float yOffset;
~ public float zOffset;
~ public float particleSpeed;
~ public int particleCount;
~ public boolean longDistance;
~ public int[] particleArguments;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 6 : 7 @ 6 : 7
~ public int state;
> EOF

View File

@ -9,4 +9,12 @@
+
> CHANGE 8 : 13 @ 8 : 13
~ public int entityId;
~ public int x;
~ public int y;
~ public int z;
~ public int type;
> EOF

View File

@ -9,4 +9,12 @@
+
> CHANGE 6 : 11 @ 6 : 11
~ public int windowId;
~ public String inventoryType;
~ public IChatComponent windowTitle;
~ public int slotCount;
~ public int entityId;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public int windowId;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 6 : 9 @ 6 : 9
~ public int windowId;
~ public int slot;
~ public ItemStack item;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public int windowId;
~ public ItemStack[] itemStacks;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 5 : 8 @ 5 : 8
~ public int windowId;
~ public int varIndex;
~ public int varValue;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 5 : 7 @ 5 : 7
~ public int windowId;
~ public short actionNumber;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 9 : 10 @ 9 : 10
~ public BlockPos blockPos;
> EOF

View File

@ -9,4 +9,15 @@
+
> CHANGE 7 : 15 @ 7 : 15
~ public int mapId;
~ public byte mapScale;
~ public Vec4b[] mapVisiblePlayersVec4b;
~ public int mapMinX;
~ public int mapMinY;
~ public int mapMaxX;
~ public int mapMaxY;
~ public byte[] mapDataBytes;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 7 : 9 @ 7 : 9
~ public BlockPos blockPos;
~ public int metadata;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 6 : 7 @ 6 : 7
~ public BlockPos signPosition;
> EOF

View File

@ -5,9 +5,49 @@
# Version: 1.0
# Author: lax1dude
> CHANGE 4 : 6 @ 4 : 6
> CHANGE 4 : 8 @ 4 : 6
~ import net.eaglerforge.api.BaseData;
~ import net.eaglerforge.api.ModData;
~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
~ import net.lax1dude.eaglercraft.v1_8.mojang.authlib.Property;
> CHANGE 10 : 12 @ 10 : 12
~ public S38PacketPlayerListItem.Action action;
~ public final List<S38PacketPlayerListItem.AddPlayerData> players = Lists.newArrayList();
> CHANGE 159 : 160 @ 159 : 160
~ public class AddPlayerData extends ModData {
> INSERT 17 : 43 @ 17
+ public void loadModData(BaseData data) {
+ // Yep, all the fields are 'final', so i can be lazy here.
+ }
+
+ public ModData makeModData() {
+ ModData data = new ModData();
+ data.setCallbackVoid("reload", () -> {
+ loadModData(data);
+ });
+ data.set("ping", ping);
+ if (gamemode != null) {
+ data.set("gamemode", gamemode.name());
+ }
+ if (displayName != null) {
+ data.set("displayNameFormatted", displayName.getFormattedText());
+ data.set("displayName", displayName.getUnformattedText());
+ }
+ if (profile != null && profile.name != null) {
+ data.set("profileName", profile.name);
+ }
+ data.setCallbackObject("getRef", () -> {
+ return this;
+ });
+ return data;
+ }
+
> EOF

View File

@ -9,4 +9,13 @@
+
> CHANGE 6 : 12 @ 6 : 12
~ public boolean invulnerable;
~ public boolean flying;
~ public boolean allowFlying;
~ public boolean creativeMode;
~ public float flySpeed;
~ public float walkSpeed;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 5 : 6 @ 5 : 6
~ public String[] matches;
> EOF

View File

@ -9,4 +9,10 @@
+
> CHANGE 7 : 10 @ 7 : 10
~ public String objectiveName;
~ public String objectiveValue;
~ public IScoreObjectiveCriteria.EnumRenderType type;
> EOF

View File

@ -9,4 +9,11 @@
+
> CHANGE 7 : 11 @ 7 : 11
~ public String name = "";
~ public String objective = "";
~ public int value;
~ public S3CPacketUpdateScore.Action action;
> EOF

View File

@ -9,4 +9,9 @@
+
> CHANGE 6 : 8 @ 6 : 8
~ public int position;
~ public String scoreName;
> EOF

View File

@ -12,4 +12,8 @@
+
+ import net.lax1dude.eaglercraft.v1_8.netty.ByteBuf;
> CHANGE 5 : 6 @ 5 : 6
~ public String channel;
> EOF

View File

@ -9,4 +9,8 @@
+
> CHANGE 6 : 7 @ 6 : 7
~ public IChatComponent reason;
> EOF

Some files were not shown because too many files have changed in this diff Show More