From 71e839831f7102f78e1ddcf764ae4a0f76ca30bc Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 9 Jan 2015 01:50:32 -0500 Subject: [PATCH] Chisel item refactor. Add chisel slot to autochisel. Refactor slot tooltip and valid items. --- .../java/com/cricketcraft/chisel/Chisel.java | 4 + .../cricketcraft/chisel/PacketHandler.java | 4 +- .../tileentity/TileEntityAutoChisel.java | 50 ++++- .../chisel/client/gui/GuiAutoChisel.java | 17 +- .../client/render/tile/RenderAutoChisel.java | 39 ++-- .../chisel/config/Configurations.java | 87 +++++--- .../cricketcraft/chisel/init/ChiselItems.java | 3 +- .../cricketcraft/chisel/init/Features.java | 7 +- .../chisel/inventory/ContainerAutoChisel.java | 41 ++-- .../chisel/inventory/ContainerChisel.java | 2 +- .../inventory/InventoryChiselSelection.java | 2 +- .../chisel/inventory/SlotChiselSelection.java | 7 +- .../cricketcraft/chisel/item/ItemChisel.java | 209 ------------------ .../chisel/item/chisel/ItemChisel.java | 97 ++++++++ .../chisel/proxy/ClientProxy.java | 15 +- .../chisel/proxy/CommonProxy.java | 11 + .../cricketcraft/chisel/utils/General.java | 2 +- .../resources/assets/chisel/lang/en_US.lang | 9 +- .../assets/chisel/textures/autochisel-gui.png | Bin 1050910 -> 1050910 bytes .../{diamondChisel.png => chisel_diamond.png} | Bin .../items/{chisel.png => chisel_iron.png} | Bin 21 files changed, 288 insertions(+), 318 deletions(-) delete mode 100644 src/main/java/com/cricketcraft/chisel/item/ItemChisel.java create mode 100644 src/main/java/com/cricketcraft/chisel/item/chisel/ItemChisel.java rename src/main/resources/assets/chisel/textures/items/{diamondChisel.png => chisel_diamond.png} (100%) rename src/main/resources/assets/chisel/textures/items/{chisel.png => chisel_iron.png} (100%) diff --git a/src/main/java/com/cricketcraft/chisel/Chisel.java b/src/main/java/com/cricketcraft/chisel/Chisel.java index ae0327d0..c1bd5dea 100644 --- a/src/main/java/com/cricketcraft/chisel/Chisel.java +++ b/src/main/java/com/cricketcraft/chisel/Chisel.java @@ -1,5 +1,6 @@ package com.cricketcraft.chisel; +import com.cricketcraft.chisel.api.IChiselItem; import com.cricketcraft.chisel.block.BlockCarvable; import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; @@ -17,9 +18,11 @@ import com.cricketcraft.chisel.inventory.ContainerAutoChisel; import com.cricketcraft.chisel.inventory.ContainerChisel; import com.cricketcraft.chisel.inventory.ContainerPresent; import com.cricketcraft.chisel.inventory.InventoryChiselSelection; +import com.cricketcraft.chisel.item.chisel.ChiselController; import com.cricketcraft.chisel.proxy.CommonProxy; import com.cricketcraft.chisel.utils.General; import com.cricketcraft.chisel.world.GeneratorChisel; + import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; @@ -136,6 +139,7 @@ public class Chisel { ChiselTabs.preInit(); Features.preInit(); PacketHandler.init(); + ChiselController.INSTANCE.preInit(); proxy.preInit(); } diff --git a/src/main/java/com/cricketcraft/chisel/PacketHandler.java b/src/main/java/com/cricketcraft/chisel/PacketHandler.java index 9c080f92..7c65050d 100644 --- a/src/main/java/com/cricketcraft/chisel/PacketHandler.java +++ b/src/main/java/com/cricketcraft/chisel/PacketHandler.java @@ -1,6 +1,6 @@ package com.cricketcraft.chisel; -import com.cricketcraft.chisel.item.ItemChisel; +import com.cricketcraft.chisel.item.chisel.ChiselController; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; @@ -10,6 +10,6 @@ public class PacketHandler { public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(Chisel.MOD_ID); public static void init() { - INSTANCE.registerMessage(ItemChisel.PlaySoundHandler.class, ItemChisel.PacketPlaySound.class, 0, Side.CLIENT); + INSTANCE.registerMessage(ChiselController.PlaySoundHandler.class, ChiselController.PacketPlaySound.class, 0, Side.CLIENT); } } \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java b/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java index 822e94c4..05d5f856 100644 --- a/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/block/tileentity/TileEntityAutoChisel.java @@ -14,6 +14,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; +import com.cricketcraft.chisel.api.IChiselItem; import com.cricketcraft.chisel.carving.Carving; import com.cricketcraft.chisel.init.ChiselItems; @@ -28,18 +29,19 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory public String getUnlocalizedName() { return ChiselItems.upgrade.getUnlocalizedName() + "_" + this.name().toLowerCase(); } - + public String getLocalizedName() { return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); } } - private final int BASE = 0, TARGET = 1, OUTPUT = 2, MIN_UPGRADE = 3; + public static final int BASE = 0, TARGET = 1, OUTPUT = 2, CHISEL = 3, MIN_UPGRADE = 4; + private static EntityItem ghostItem; boolean equal = false; - private ItemStack[] inventory = new ItemStack[6]; + private ItemStack[] inventory = new ItemStack[7]; private String name = "autoChisel"; - + public float xRot, yRot, zRot; // used for floating target client only @Override @@ -92,7 +94,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory ItemStack base = inventory[BASE], target = inventory[TARGET], output = inventory[OUTPUT]; - if (!worldObj.isRemote && worldObj.getWorldTime() % checkPeriod == 0) { + if (!worldObj.isRemote && worldObj.getWorldTime() % checkPeriod == 0 && hasChisel()) { if (base != null && target != null) { if (canBeMadeFrom(base, target)) { // the max possible for this craft @@ -130,6 +132,9 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory if (base.stackSize <= 0) { inventory[BASE] = null; // clear out 0 size itemstacks } + + ((IChiselItem) inventory[CHISEL].getItem()).onChisel(worldObj, this, CHISEL, inventory[CHISEL], inventory[TARGET]); + // we changed something, so we need to tell the chunk to save markDirty(); } @@ -163,6 +168,10 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory return false; } + private boolean hasChisel() { + return inventory[CHISEL] != null && inventory[CHISEL].getItem() == ChiselItems.chisel && inventory[CHISEL].stackSize >= 1; + } + @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); @@ -241,7 +250,21 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory @Override public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - return true; + if (itemStack == null) { + return false; + } + + switch(slot) { + case BASE: + case TARGET: + return !Carving.chisel.getItems(itemStack).isEmpty(); + case OUTPUT: + return false; + case CHISEL: + return itemStack.getItem() instanceof IChiselItem; + default: + return itemStack.getItem() == ChiselItems.upgrade && Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage(); + } } @Override @@ -308,4 +331,19 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory } return false; } + + public String getSlotTooltipUnloc(int slotNumber) { + String base = "autochisel.slot.%s.tooltip"; + String name = null; + if (slotNumber < MIN_UPGRADE) { + if (slotNumber == TARGET) { + name = "target"; + } else if (slotNumber == CHISEL) { + name = "chisel"; + } + return name == null ? null : String.format(base, name); + } else { + return Upgrade.values()[slotNumber - MIN_UPGRADE].getUnlocalizedName() + ".name"; + } + } } diff --git a/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java b/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java index 9635add8..50579aaf 100644 --- a/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/client/gui/GuiAutoChisel.java @@ -13,15 +13,19 @@ import org.lwjgl.opengl.GL11; import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; import com.cricketcraft.chisel.inventory.ContainerAutoChisel; -import com.cricketcraft.chisel.inventory.ContainerAutoChisel.SlotUpgrade; +import com.cricketcraft.chisel.inventory.ContainerAutoChisel.SlotAutoChisel; +import com.google.common.base.Strings; import com.google.common.collect.Lists; public class GuiAutoChisel extends GuiContainer { private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png"); + private TileEntityAutoChisel autochisel; + public GuiAutoChisel(InventoryPlayer inventoryPlayer, TileEntityAutoChisel tileEntityAutoChisel) { super(new ContainerAutoChisel(inventoryPlayer, tileEntityAutoChisel)); + autochisel = tileEntityAutoChisel; } @SuppressWarnings("unchecked") @@ -34,16 +38,17 @@ public class GuiAutoChisel extends GuiContainer { for (Slot slot : (List) inventorySlots.inventorySlots) { if (mouseInside(slot, mouseX - x, mouseY - y)) { - if (slot instanceof SlotUpgrade) { - this.func_146283_a(Lists.newArrayList(((SlotUpgrade) slot).upgradeType.getLocalizedName()), mouseX - x, mouseY - y); - } else if (slot.slotNumber == 1) { - this.func_146283_a(Lists.newArrayList(StatCollector.translateToLocal("autochisel.slot.target.tooltip")), mouseX - x, mouseY - y); + if (slot instanceof SlotAutoChisel) { + String tt = autochisel.getSlotTooltipUnloc(slot.slotNumber); + if (!Strings.isNullOrEmpty(tt)) { + this.func_146283_a(Lists.newArrayList(StatCollector.translateToLocal(tt)), mouseX - x, mouseY - y); + } } } } RenderHelper.enableGUIStandardItemLighting(); } - + private boolean mouseInside(Slot slot, int x, int y) { return x >= slot.xDisplayPosition && x <= slot.xDisplayPosition + 16 && y >= slot.yDisplayPosition && y <= slot.yDisplayPosition + 16; } diff --git a/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java b/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java index ca0d936e..82a91b04 100644 --- a/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/client/render/tile/RenderAutoChisel.java @@ -116,29 +116,19 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp private static EntityItem ghostItem; - private final RenderItem renderTargetAndChisel, renderBase; + private final RenderItem renderItem; public RenderAutoChisel() { Chisel.renderAutoChiselId = RenderingRegistry.getNextAvailableRenderId(); - renderTargetAndChisel = new RenderItem() { + renderItem = new RenderItem() { @Override public boolean shouldBob() { return false; } }; - renderTargetAndChisel.setRenderManager(RenderManager.instance); - - renderBase = new RenderItem() { - - @Override - public boolean shouldBob() { - return true; - } - }; - - renderBase.setRenderManager(RenderManager.instance); + renderItem.setRenderManager(RenderManager.instance); } private static final Random rand = new Random(); @@ -148,7 +138,7 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp // Render Blocks TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile; - EntityItem item = autoChisel.getItemForRendering(1); + EntityItem item = autoChisel.getItemForRendering(TileEntityAutoChisel.TARGET); rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord); rand.nextBoolean(); @@ -170,17 +160,26 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp GL11.glRotatef(autoChisel.zRot, 0, 0, 1); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_CONSTANT_ALPHA); - renderTargetAndChisel.doRender(item, 0, 0, 0, 0, 0); + renderItem.doRender(item, 0, 0, 0, 0, 0); GL11.glPopMatrix(); GL11.glPopAttrib(); } - EntityItem item2 = autoChisel.getItemForRendering(0); - - if (item2 != null) { + item = autoChisel.getItemForRendering(TileEntityAutoChisel.BASE); + if (item != null) { GL11.glPushMatrix(); - GL11.glTranslated(x + 0.4, y + 0.83, z + 0.5); - renderBase.doRender(item2, 0, 0, 0, 0, 0); + GL11.glTranslated(x + 0.35, y + 0.934, z + 0.5); + renderItem.doRender(item, 0, 0, 0, 0, 0); + GL11.glPopMatrix(); + } + + item = autoChisel.getItemForRendering(TileEntityAutoChisel.CHISEL); + if (item != null) { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.7, y + 1, z + 0.5); + GL11.glTranslated(-0.12, 0, 0); + GL11.glScalef(0.9f, 0.9f, 0.9f); + renderItem.doRender(item, 0, 0, 0, 0, 0); GL11.glPopMatrix(); } } diff --git a/src/main/java/com/cricketcraft/chisel/config/Configurations.java b/src/main/java/com/cricketcraft/chisel/config/Configurations.java index 85b229cd..25e3ecae 100644 --- a/src/main/java/com/cricketcraft/chisel/config/Configurations.java +++ b/src/main/java/com/cricketcraft/chisel/config/Configurations.java @@ -13,48 +13,69 @@ public class Configurations { public static Configuration config; public static boolean configExists; - public static boolean oldPillars; - public static boolean disableCTM; - public static boolean blockDescriptions; + + public static double concreteVelocity; public static boolean ghostCloud; - public static boolean chiselStoneToCobbleBricks; + public static int factoryBlockAmount; public static boolean allowMossy; public static boolean chiselRecipe; - public static boolean autoChisel; - public static boolean fancy; public static boolean enableFMP; + public static boolean chiselStoneToCobbleBricks; - public static int factoryBlockAmount; - public static int particlesTickrate; public static int marbleAmount; public static int limestoneAmount; public static int graniteAmount; public static int dioriteAmount; public static int andesiteAmount; - public static double concreteVelocity; + public static int particlesTickrate; + public static boolean oldPillars; + public static boolean disableCTM; + public static boolean fancy; + public static boolean blockDescriptions; + + public static boolean allowChiselDamage; + public static int ironChiselMaxDamage; + public static int diamondChiselMaxDamage; public static boolean refreshConfig() { - concreteVelocity = config.get("general", "concreteVelocity", 0.45, + + String category; + + /* general */ + category = "general"; + concreteVelocity = config.get(category, "concreteVelocity", 0.45, "Traversing concrete roads, players will acceleration to this velocity. For reference, normal running speed is about 0.28. Set to 0 to disable acceleration.").getDouble(0.45); - particlesTickrate = config.get("client", "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1); - oldPillars = config.get("client", "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false); - disableCTM = !config.get("client", "connectedTextures", true, "Enable connected textures").getBoolean(true); - fancy = config.get("client", "fancyLeaves", true, "Enable fancy textures").getBoolean(true); - blockDescriptions = config.get("client", "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.") + ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true).getBoolean(true); + factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32).getInt(32); + allowMossy = config.get(category, "allowCobbleToMossyInChisel", true).getBoolean(true); + chiselRecipe = config.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false); + enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true); + chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); + + /* worldgen */ + category = "worldgen"; + marbleAmount = config.get(category, "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7); + limestoneAmount = config.get(category, "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8); + graniteAmount = config.get(category, "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8); + dioriteAmount = config.get(category, "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8); + andesiteAmount = config.get(category, "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8); + + /* client */ + category = "client"; + particlesTickrate = config.get(category, "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1); + oldPillars = config.get(category, "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false); + disableCTM = !config.get(category, "connectedTextures", true, "Enable connected textures").getBoolean(true); + fancy = config.get(category, "fancyLeaves", true, "Enable fancy textures").getBoolean(true); + blockDescriptions = config.get(category, "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.") .getBoolean(true); - ghostCloud = config.get("general", "doesCloudRenderLikeGhost", true).getBoolean(true); - factoryBlockAmount = config.get("general", "amountYouGetFromFactoryBlockCrafting", 32).getInt(32); - allowMossy = config.get("general", "allowCobbleToMossyInChisel", true).getBoolean(true); - marbleAmount = config.get("worldgen", "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none").getInt(7); - limestoneAmount = config.get("worldgen", "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none").getInt(8); - graniteAmount = config.get("worldgen", "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.").getInt(8); - dioriteAmount = config.get("worldgen", "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.").getInt(8); - andesiteAmount = config.get("worldgen", "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.").getInt(8); - chiselRecipe = config.get("general", "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel").getBoolean(false); - autoChisel = config.get("general", "autoChisel", true, "Should people be allowed to use the auto chisel").getBoolean(true); - enableFMP = config.get("general", "enableFMP", true, "Do you want to enable FMP").getBoolean(true); - chiselStoneToCobbleBricks = config.get("general", "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false); + + /* chisel */ + + category = "chisel"; + allowChiselDamage = config.get(category, "allowChiselDamage", true, "Should the chisel be damageable and take damage when it chisels something.").getBoolean(); + ironChiselMaxDamage = config.get(category, "ironChiselMaxDamage", 500, "The max damage of the standard iron chisel. Default: 500.").getInt(); + diamondChiselMaxDamage = config.get(category, "diamondChiselMaxDamage", 5000, "The max damage of the diamond chisel. Default: 5000").getInt(); if (config.hasChanged()) { config.save(); @@ -65,21 +86,23 @@ public class Configurations { public static boolean featureEnabled(Features feature) { return config.get("features", featureName(feature), true).getBoolean(true) && refreshConfig(); } - + // this makes the old camelCase names from the new CONSTANT_CASE names - private static String featureName (Features feature) { + private static String featureName(Features feature) { String[] words = feature.name().toLowerCase(Locale.ENGLISH).split("_"); if (words.length == 1) { return words[0]; } - + String ret = words[0]; for (int i = 1; i < words.length; i++) { ret += StringUtils.capitalize(words[i]); } return ret; } - + @Deprecated - public static boolean featureEnabled(String feature) {return false;} + public static boolean featureEnabled(String feature) { + return false; + } } diff --git a/src/main/java/com/cricketcraft/chisel/init/ChiselItems.java b/src/main/java/com/cricketcraft/chisel/init/ChiselItems.java index 227b59a2..df71049d 100644 --- a/src/main/java/com/cricketcraft/chisel/init/ChiselItems.java +++ b/src/main/java/com/cricketcraft/chisel/init/ChiselItems.java @@ -2,10 +2,10 @@ package com.cricketcraft.chisel.init; import com.cricketcraft.chisel.Chisel; import com.cricketcraft.chisel.item.ItemBallOMoss; -import com.cricketcraft.chisel.item.ItemChisel; import com.cricketcraft.chisel.item.ItemCloudInABottle; import com.cricketcraft.chisel.item.ItemSmashingRock; import com.cricketcraft.chisel.item.ItemUpgrade; +import com.cricketcraft.chisel.item.chisel.ItemChisel; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @@ -13,6 +13,7 @@ import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; public final class ChiselItems { public static final ItemChisel chisel = null; + public static final ItemChisel diamondChisel = null; public static final ItemCloudInABottle cloudinabottle = null; public static final ItemBallOMoss ballomoss = null; public static final ItemSmashingRock smashingrock = null; diff --git a/src/main/java/com/cricketcraft/chisel/init/Features.java b/src/main/java/com/cricketcraft/chisel/init/Features.java index 440fed47..113fbc01 100644 --- a/src/main/java/com/cricketcraft/chisel/init/Features.java +++ b/src/main/java/com/cricketcraft/chisel/init/Features.java @@ -59,11 +59,12 @@ import com.cricketcraft.chisel.entity.EntityCloudInABottle; import com.cricketcraft.chisel.entity.EntitySmashingRock; import com.cricketcraft.chisel.item.ItemBallOMoss; import com.cricketcraft.chisel.item.ItemCarvable; -import com.cricketcraft.chisel.item.ItemChisel; import com.cricketcraft.chisel.item.ItemCloudInABottle; import com.cricketcraft.chisel.item.ItemMarbleSlab; import com.cricketcraft.chisel.item.ItemSmashingRock; import com.cricketcraft.chisel.item.ItemUpgrade; +import com.cricketcraft.chisel.item.chisel.ItemChisel; +import com.cricketcraft.chisel.item.chisel.ItemChisel.ChiselType; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.EntityRegistry; @@ -314,8 +315,10 @@ public enum Features { @Override void addItems() { - ItemChisel chisel = (ItemChisel) new ItemChisel().setCreativeTab(ChiselTabs.tabChisel); + ItemChisel chisel = (ItemChisel) new ItemChisel(ChiselType.IRON).setCreativeTab(ChiselTabs.tabChisel); + ItemChisel diamondChisel = (ItemChisel) new ItemChisel(ChiselType.DIAMOND).setCreativeTab(ChiselTabs.tabChisel); GameRegistry.registerItem(chisel, "chisel"); + GameRegistry.registerItem(diamondChisel, "diamondChisel"); } @Override diff --git a/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java b/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java index e1853928..ee6240e7 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/ContainerAutoChisel.java @@ -7,23 +7,18 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; -import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel.Upgrade; -import com.cricketcraft.chisel.init.ChiselItems; public class ContainerAutoChisel extends Container { - public static class SlotUpgrade extends Slot { + public static class SlotAutoChisel extends Slot { - public Upgrade upgradeType; - - public SlotUpgrade(TileEntityAutoChisel inv, int id, int x, int y, Upgrade upgrade) { + public SlotAutoChisel(TileEntityAutoChisel inv, int id, int x, int y) { super(inv, id, x, y); - this.upgradeType = upgrade; } @Override public boolean isItemValid(ItemStack stack) { - return stack.getItem() == ChiselItems.upgrade && stack.getItemDamage() == upgradeType.ordinal(); + return inventory.isItemValidForSlot(slotNumber, stack); } } @@ -35,12 +30,13 @@ public class ContainerAutoChisel extends Container { ContainerAutoChisel.player = player.player; autoChisel = tileEntityAutoChisel; - addSlotToContainer(new Slot(tileEntityAutoChisel, 0, 53, 15)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 78, 51)); - addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 103, 15)); - addSlotToContainer(new SlotUpgrade(tileEntityAutoChisel, 3, 151, 11, Upgrade.SPEED)); - addSlotToContainer(new SlotUpgrade(tileEntityAutoChisel, 4, 151, 31, Upgrade.AUTOMATION)); - addSlotToContainer(new SlotUpgrade(tileEntityAutoChisel, 5, 151, 51, Upgrade.STACK)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 0, 53, 15)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 1, 78, 51)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 2, 103, 15)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 3, 8, 62)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 4, 151, 11)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 5, 151, 31)); + addSlotToContainer(new SlotAutoChisel(tileEntityAutoChisel, 6, 151, 51)); bindPlayerInventory(player); } @@ -73,22 +69,13 @@ public class ContainerAutoChisel extends Container { itemStack = itemStack1.copy(); // if we are in the auto chisel - if (slotNumber <= 5) { + if (slotNumber <= 6) { if (!this.mergeItemStack(itemStack1, 33, 42, false)) { return null; } - } else { - // if this is an upgrade, check the upgrade slots - if (itemStack1.getItem() == ChiselItems.upgrade) { - if (!this.mergeItemStack(itemStack1, 3, 6, false)) { - return null; - } - } else { - // otherwise just put it in one of the 3 other slots - if (!this.mergeItemStack(itemStack1, 0, 3, false)) { - return null; - } - } + // otherwise just put it in one of the machine slots + } else if (!this.mergeItemStack(itemStack1, 0, 7, false)) { + return null; } if (itemStack1.stackSize == 0) { diff --git a/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java b/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java index aeca0159..23421400 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/ContainerChisel.java @@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import com.cricketcraft.chisel.carving.Carving; -import com.cricketcraft.chisel.item.ItemChisel; +import com.cricketcraft.chisel.item.chisel.ItemChisel; import com.cricketcraft.chisel.utils.General; public class ContainerChisel extends Container { diff --git a/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java b/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java index e5cbfca7..503e7ced 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/InventoryChiselSelection.java @@ -8,7 +8,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import com.cricketcraft.chisel.item.ItemChisel; +import com.cricketcraft.chisel.item.chisel.ItemChisel; public class InventoryChiselSelection implements IInventory { diff --git a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java index a6e02c8d..9c2a53db 100644 --- a/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java +++ b/src/main/java/com/cricketcraft/chisel/inventory/SlotChiselSelection.java @@ -5,7 +5,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import com.cricketcraft.chisel.utils.General; +import com.cricketcraft.chisel.api.IChiselItem; public class SlotChiselSelection extends Slot { @@ -54,9 +54,8 @@ public class SlotChiselSelection extends Slot { } selInventory.updateItems(); - - String sound = container.carving.getVariationSound(itemstack.getItem(), itemstack.getItemDamage()); - player.worldObj.playSoundAtEntity(player, sound, 0.3f + 0.7f * General.rand.nextFloat(), 0.6f + 0.4f * General.rand.nextFloat()); + + ((IChiselItem)container.chisel.getItem()).onChisel(player.worldObj, player.inventory, player.inventory.currentItem, container.chisel, crafted); /* * ItemStack stack=player.inventory.getItemStack(); diff --git a/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java b/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java deleted file mode 100644 index 4d5f96f1..00000000 --- a/src/main/java/com/cricketcraft/chisel/item/ItemChisel.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.cricketcraft.chisel.item; - -import io.netty.buffer.ByteBuf; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; - -import org.apache.commons.lang3.ArrayUtils; - -import com.cricketcraft.chisel.Chisel; -import com.cricketcraft.chisel.PacketHandler; -import com.cricketcraft.chisel.api.ChiselMode; -import com.cricketcraft.chisel.api.IChiselMode; -import com.cricketcraft.chisel.carving.Carving; -import com.cricketcraft.chisel.carving.CarvingVariation; -import com.cricketcraft.chisel.client.GeneralChiselClient; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemChisel extends Item implements IChiselMode { - - public static Carving carving = Carving.chisel; - - @SideOnly(Side.CLIENT) - private IIcon ironIcon; - @SideOnly(Side.CLIENT) - private IIcon diamondIcon; - - public ItemChisel() { - super(); - setMaxStackSize(1); - setHasSubtypes(true); - MinecraftForge.EVENT_BUS.register(this); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) { - ironIcon = register.registerIcon(Chisel.MOD_ID + ":chisel"); - diamondIcon = register.registerIcon(Chisel.MOD_ID + ":diamondChisel"); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int pass) { - return getIconFromDamage(stack.getItemDamage()); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int damage) { - return damage == 0 ? ironIcon : diamondIcon; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - list.add(new ItemStack(item, 1, 0)); - list.add(new ItemStack(item, 1, 1)); - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - String name = stack.getItemDamage() == 0 ? "chisel" : "diamondChisel"; - return "item." + name; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean held) { - list.add(StatCollector.translateToLocal(getUnlocalizedName(stack) + ".desc")); - } - - @Override - public boolean isFull3D() { - return true; - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - entityplayer.openGui(Chisel.instance, 0, world, 0, 0, 0); - - return itemstack; - } - - @SubscribeEvent - public void onLeftClickBlock(PlayerInteractEvent event) { - ItemStack held = event.entityPlayer.getCurrentEquippedItem(); - int slot = event.entityPlayer.inventory.currentItem; - // TODO config for diamond only - if (event.action == Action.LEFT_CLICK_BLOCK && held != null && held.getItem() == this) { - int x = event.x, y = event.y, z = event.z; - Block block = event.world.getBlock(x, y, z); - int metadata = event.world.getBlockMetadata(x, y, z); - CarvingVariation[] variations = carving.getVariations(block, metadata); - - if (variations != null) { - ItemStack target = getTarget(held); - - if (target != null) { - for (CarvingVariation v : variations) { - if (v.block == Block.getBlockFromItem(target.getItem()) && v.meta == target.getItemDamage()) { - setVariation(event.entityPlayer, event.world, x, y, z, v); - } - } - } else { - for (int i = 0; i < variations.length; i++) { - CarvingVariation v = variations[i]; - if (v.block == block && v.meta == metadata) { - variations = ArrayUtils.remove(variations, i--); - } - } - - int index = event.world.rand.nextInt(variations.length); - CarvingVariation newVar = variations[index]; - setVariation(event.entityPlayer, event.world, x, y, z, newVar); - event.entityPlayer.inventory.currentItem = slot; - } - } - } - } - - /** - * Assumes that the player is holding a chisel - */ - private void setVariation(EntityPlayer player, World world, int x, int y, int z, CarvingVariation v) { - PacketHandler.INSTANCE.sendTo(new PacketPlaySound(x, y, z, v), (EntityPlayerMP) player); - world.setBlock(x, y, z, v.block); - world.setBlockMetadataWithNotify(x, y, z, v.meta, 3); - player.getCurrentEquippedItem().damageItem(1, player); - if (player.getCurrentEquippedItem().stackSize <= 0) { - player.destroyCurrentEquippedItem(); - } - } - - public ItemStack getTarget(ItemStack chisel) { - return chisel.hasTagCompound() ? ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")) : null; - } - - @Override - public ChiselMode getChiselMode(ItemStack itemStack) { - // TODO - return ChiselMode.SINGLE; - } - - public static class PacketPlaySound implements IMessage { - - public PacketPlaySound() { - } - - private int x, y, z; - private int block; - private byte meta; - - public PacketPlaySound(int x, int y, int z, CarvingVariation v) { - this.x = x; - this.y = y; - this.z = z; - this.block = Block.getIdFromBlock(v.block); - this.meta = (byte) v.meta; - } - - @Override - public void toBytes(ByteBuf buf) { - buf.writeInt(x); - buf.writeInt(y); - buf.writeInt(z); - buf.writeInt(block); - buf.writeByte(meta); - } - - @Override - public void fromBytes(ByteBuf buf) { - x = buf.readInt(); - y = buf.readInt(); - z = buf.readInt(); - block = buf.readInt(); - meta = buf.readByte(); - } - } - - public static class PlaySoundHandler implements IMessageHandler { - - @Override - public IMessage onMessage(PacketPlaySound message, MessageContext ctx) { - String sound = ItemChisel.carving.getVariationSound(Block.getBlockById(message.block), message.meta); - GeneralChiselClient.spawnChiselEffect(message.x, message.y, message.z, sound); - return null; - } - } -} \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/item/chisel/ItemChisel.java b/src/main/java/com/cricketcraft/chisel/item/chisel/ItemChisel.java new file mode 100644 index 00000000..2e871af4 --- /dev/null +++ b/src/main/java/com/cricketcraft/chisel/item/chisel/ItemChisel.java @@ -0,0 +1,97 @@ +package com.cricketcraft.chisel.item.chisel; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + +import com.cricketcraft.chisel.Chisel; +import com.cricketcraft.chisel.api.ChiselMode; +import com.cricketcraft.chisel.api.IChiselItem; +import com.cricketcraft.chisel.carving.Carving; +import com.cricketcraft.chisel.config.Configurations; +import com.cricketcraft.chisel.utils.GeneralClient; + +public class ItemChisel extends Item implements IChiselItem { + + public enum ChiselType { + IRON(Configurations.ironChiselMaxDamage), DIAMOND(Configurations.diamondChiselMaxDamage); + + final int maxDamage; + + ChiselType(int maxDamage) { + this.maxDamage = maxDamage; + } + } + + public static Carving carving = Carving.chisel; + + private ChiselType type; + + public ItemChisel(ChiselType type) { + super(); + this.type = type; + setMaxStackSize(1); + setHasSubtypes(true); + setTextureName(Chisel.MOD_ID + ":chisel_" + type.name().toLowerCase()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public int getMaxDamage(ItemStack stack) { + if (Configurations.allowChiselDamage) { + return type.maxDamage; + } + return 0; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return "item." + Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase(); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean held) { + list.add(StatCollector.translateToLocal(getUnlocalizedName(stack) + ".desc")); + } + + @Override + public boolean isFull3D() { + return true; + } + + @Override + public ChiselMode getChiselMode(ItemStack itemStack) { + return ChiselMode.SINGLE; + } + + @Override + public void onChisel(World world, IInventory inv, int slot, ItemStack chisel, ItemStack target) { + if (Configurations.allowChiselDamage) { + chisel.setItemDamage(chisel.getItemDamage() + 1); + } + + if (world.isRemote) { + String sound = carving.getVariationSound(target.getItem(), target.getItemDamage()); + EntityPlayer player = Chisel.proxy.getClientPlayer(); + GeneralClient.playChiselSound(world, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), sound); + } else { + if (chisel.getItemDamage() >= chisel.getMaxDamage()) { + inv.decrStackSize(slot, 1); + } + } + } + + @Override + public ItemStack getTarget(ItemStack chisel) { + return chisel.hasTagCompound() ? ItemStack.loadItemStackFromNBT(chisel.stackTagCompound.getCompoundTag("chiselTarget")) : null; + } + +} \ No newline at end of file diff --git a/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java b/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java index 65c9d881..fd9e7fbf 100644 --- a/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java +++ b/src/main/java/com/cricketcraft/chisel/proxy/ClientProxy.java @@ -1,7 +1,10 @@ package com.cricketcraft.chisel.proxy; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderSnowball; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import com.cricketcraft.chisel.Chisel; @@ -58,7 +61,7 @@ public class ClientProxy extends CommonProxy { RenderingRegistry.registerBlockHandler(rac); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ChiselBlocks.autoChisel), rac); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, rac); - + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, new RenderPresent()); for (int x = 0; x < 16; x++) { @@ -71,4 +74,14 @@ public class ClientProxy extends CommonProxy { MinecraftForgeClient.registerItemRenderer(ChiselItems.chisel, renderer); } + + @Override + public EntityPlayer getClientPlayer() { + return Minecraft.getMinecraft().thePlayer; + } + + @Override + public World getClientWorld() { + return Minecraft.getMinecraft().theWorld; + } } diff --git a/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java b/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java index 86af073b..aa2a8bb9 100644 --- a/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java +++ b/src/main/java/com/cricketcraft/chisel/proxy/CommonProxy.java @@ -1,5 +1,8 @@ package com.cricketcraft.chisel.proxy; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel; import com.cricketcraft.chisel.block.tileentity.TileEntityPresent; @@ -17,4 +20,12 @@ public class CommonProxy { public void init() { } + + public EntityPlayer getClientPlayer() { + return null; + } + + public World getClientWorld() { + return null; + } } diff --git a/src/main/java/com/cricketcraft/chisel/utils/General.java b/src/main/java/com/cricketcraft/chisel/utils/General.java index 4cb71915..1193d6a9 100644 --- a/src/main/java/com/cricketcraft/chisel/utils/General.java +++ b/src/main/java/com/cricketcraft/chisel/utils/General.java @@ -89,6 +89,6 @@ public class General { Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21); return par1World.rayTraceBlocks(var13, var23, par3); } - + public static final String[] sGNames = new String[] { "White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", "Pink", "Gray", "Light Gray", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" }; } diff --git a/src/main/resources/assets/chisel/lang/en_US.lang b/src/main/resources/assets/chisel/lang/en_US.lang index c0796db6..b6596c9c 100644 --- a/src/main/resources/assets/chisel/lang/en_US.lang +++ b/src/main/resources/assets/chisel/lang/en_US.lang @@ -1,8 +1,10 @@ # Key localizations # Item localizations -item.chisel.name=Chisel +item.chisel.chisel_iron.name=Chisel item.chisel.desc=Right-Click to open GUI +item.chisel.chisel_diamond.name=Diamond Chisel +item.chisel.chisel_diamond.desc=Left click and it changes blocks! item.ballMoss.name=Ball O' Moss item.ballMoss.desc=Right-Click to throw. This will turn Cobblestone to Moss Stone on impact. item.cloudBottle.name=Cloud In A Bottle @@ -37,12 +39,9 @@ tile.granite.name=Granite tile.granite.0.desc=Generates in your world tile.granite.1.desc=Polished Granite -#Diamond Chisel -item.diamondChisel.name=Diamond Chisel -item.diamondChisel.desc=Left click and it changes blocks! - #Auto Chisel tile.autoChisel.name=Auto Chisel +autochisel.slot.chisel.tooltip=Chisel Slot autochisel.slot.target.tooltip=Target Slot #Leaves diff --git a/src/main/resources/assets/chisel/textures/autochisel-gui.png b/src/main/resources/assets/chisel/textures/autochisel-gui.png index a17ef8bc1d4980eaece45165cad09b29be649dc2..1d18c7df5a43bec653f0accb65e8e951b6361269 100644 GIT binary patch delta 4254 zcmbtWeNa@_72kW`-M5dg?y8_hq3kFbpkm!BqgXLrD;B>HD#XUYT1?xqj*Y>Ic1Y9! zsRS9s084X2Q^b#U9ZkcBJM~H}f}?5HG*mFLh?7hp!B*Y0m&Oj{LwGp;qi+9=L0iYTGN+NDKlt|E)a9J$1k zGtpqM8dhX1$#ZPCrMUXt%Z-i(o96I5ZgDleS3*x!Y11@*Xb#m}4YmTK%L!|)mVN&; zG4t95*B!+LQ+V|^=wkpbH@d9OA|p^F8^L18?Alc@%?WD-R2=#)?IOH7mS{XDmRRxM zF-Ob3x5kzPEZK>}>a>VIN0E_M*2_OCAdAuYcVo_WX#>{jk6241ygQCC5m}(g6P6>s^BAOfIxj4x^B|`U6j3{c949Eavl_~~9kAa^l_X^>&M&BdRo?=* zjZgt`uM%*(McLP0p4`UG17s~A)PgLnj2B+lG|^e1*%jEB=1ZFOJ(31foA|+>NDATO zr>l|dEMz^9+E-5JjxN6QjG{HZQ8iLC?lU=pmoFohj%`ol19+@#cC zz*goe{7sT7?=;TaWTosA=DV~L+rSQ!cx8$5)5*Z@RSX3QS5w|{oA*kC?`DOao4YFt zS?iId!fPaQVo3?s(QR4FrDLvk5O49j-;nV055iVI+^@rMf1i?$&8ftOt)$!0ao56A zij@yQUn61X&gX7`EYIPcd&8eYA*ED+Q#IPY%e#yulFu(!@JQjvygC71F5;_{FR+?Y zamzJS^w%lriq|UVmr55N?5l)by1FffUm8%H=z186bOR}rD)2b<|R1@Ym zl~^wckU~kO3&mF~1;1Bhu^b>Qx3&ItkjWLD5`4uy?gg0*_JI^4!CR#;bf*$sYw6FY-J>ZR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