mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
IChiselItem items no longer need to worry about playing the sound fx.
Remove ChiselMode from API packages
This commit is contained in:
1 parent
a3f8c357e3
commit
4de7ef8190
7 files changed
+14
-13
No files matched your search
@@ -6,14 +6,13 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselMode;
|
||||
import com.cricketcraft.chisel.inventory.ContainerChisel;
|
||||
import com.cricketcraft.chisel.inventory.InventoryChiselSelection;
|
||||
import com.cricketcraft.chisel.inventory.SlotChiselInput;
|
||||
import com.cricketcraft.chisel.item.chisel.ChiselMode;
|
||||
import com.cricketcraft.chisel.network.PacketHandler;
|
||||
import com.cricketcraft.chisel.network.message.MessageChiselMode;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
|
||||
@@ -4,9 +4,13 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
import com.cricketcraft.chisel.utils.GeneralClient;
|
||||
|
||||
public class SlotChiselSelection extends Slot {
|
||||
|
||||
@@ -58,6 +62,11 @@ public class SlotChiselSelection extends Slot {
|
||||
|
||||
((IChiselItem)container.chisel.getItem()).onChisel(player.worldObj, player.inventory, player.inventory.currentItem, container.chisel, General.getVariation(crafted));
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
String sound = Carving.chisel.getVariationSound(crafted.getItem(), crafted.getItemDamage());
|
||||
GeneralClient.playChiselSound(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), sound);
|
||||
}
|
||||
|
||||
/*
|
||||
* ItemStack stack=player.inventory.getItemStack();
|
||||
*
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.api.ChiselMode;
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
package com.cricketcraft.chisel.api;
|
||||
package com.cricketcraft.chisel.item.chisel;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.network.PacketHandler;
|
||||
import com.cricketcraft.chisel.network.message.MessageChiselSound;
|
||||
@@ -13,7 +13,6 @@ 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.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
@@ -96,12 +95,6 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
inv.decrStackSize(slot, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (world.isRemote) {
|
||||
String sound = carving.getVariationSound(target.getBlock(), target.getItemMeta());
|
||||
EntityPlayer player = Chisel.proxy.getClientPlayer();
|
||||
GeneralClient.playChiselSound(world, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), sound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.cricketcraft.chisel.network.message;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselMode;
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.item.chisel.ChiselMode;
|
||||
import com.cricketcraft.chisel.utils.General;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
|
||||
@@ -15,9 +15,9 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselMode;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.carving.Carving;
|
||||
import com.cricketcraft.chisel.item.chisel.ChiselMode;
|
||||
|
||||
public class General {
|
||||
|
||||
|
||||
Reference in new issue
Block a user