mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 21:57:40 +00:00
Updated Banners
This commit is contained in:
1 parent
2f5d5f84c2
commit
4d2ced4528
25 files changed
+314
-85
No files matched your search
@@ -11,6 +11,7 @@ import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -255,11 +256,23 @@ public class ServerEventsHandler {
|
||||
}
|
||||
|
||||
if(!player.worldObj.isRemote){
|
||||
if(block == CustomItems.banner || block == CustomItems.wallBanner){
|
||||
// If sneaking and using shear
|
||||
if(player.isSneaking() && item.getItem() == Items.shears){
|
||||
int currentVariantIndex = tile.variant.ordinal();
|
||||
int nextVariantIndex = (currentVariantIndex + 1) % EnumBannerVariant.values().length;
|
||||
tile.variant = EnumBannerVariant.values()[nextVariantIndex];
|
||||
|
||||
player.worldObj.markBlockForUpdate(event.x, y, event.z);
|
||||
event.setCanceled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
tile.icon = item.copy();
|
||||
player.worldObj.markBlockForUpdate(event.x, y, event.z);
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user