Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EntityAdvancedFrame extends EntityItemFrame{
- public EntityAdvancedFrame(World world) {
- super(world);
- }
- public EntityAdvancedFrame(World world, int p_i1591_2_, int p_i1591_3_, int p_i1591_4_, int p_i1591_5_)
- {
- super(world, p_i1591_2_, p_i1591_3_, p_i1591_4_, p_i1591_5_);
- }
- /**
- * Called when the entity is attacked.
- */
- public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
- {
- //Here we check if player, who trying to destroy frame is opped
- if(Arrays.asList(MinecraftServer.getServer().getConfigurationManager().func_152603_m().func_152685_a()).contains(((EntityPlayer) p_70097_1_.getEntity()).getDisplayName()))
- {
- if (this.isEntityInvulnerable())
- {
- return false;
- }
- else if (this.getDisplayedItem() != null)
- {
- if (!this.worldObj.isRemote)
- {
- this.func_146065_b(p_70097_1_.getEntity(), false);
- this.setDisplayedItem((ItemStack)null);
- }
- return true;
- }
- else
- {
- return super.attackEntityFrom(p_70097_1_, p_70097_2_);
- }
- } else {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment