Prevent hoppers from picking up items

This commit is contained in:
filoghost 2018-08-20 13:34:02 +02:00
parent a2dbc9c318
commit 1b3a29aab6
9 changed files with 99 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import net.minecraft.server.v1_10_R1.NBTTagList;
import net.minecraft.server.v1_10_R1.NBTTagString;
import net.minecraft.server.v1_10_R1.PacketPlayOutMount;
import net.minecraft.server.v1_10_R1.World;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
public class EntityNMSItem extends EntityItem implements NMSItem {
@ -39,6 +40,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -135,6 +137,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return false;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -23,6 +23,7 @@ import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.NBTTagList;
import net.minecraft.server.v1_11_R1.NBTTagString;
import net.minecraft.server.v1_11_R1.World;
import net.minecraft.server.v1_11_R1.AxisAlignedBB;
public class EntityNMSItem extends EntityItem implements NMSItem {
@ -35,6 +36,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -111,6 +113,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return false;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -23,6 +23,7 @@ import net.minecraft.server.v1_12_R1.NBTTagCompound;
import net.minecraft.server.v1_12_R1.NBTTagList;
import net.minecraft.server.v1_12_R1.NBTTagString;
import net.minecraft.server.v1_12_R1.World;
import net.minecraft.server.v1_12_R1.AxisAlignedBB;
public class EntityNMSItem extends EntityItem implements NMSItem {
@ -35,6 +36,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -111,6 +113,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return false;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -12,6 +12,7 @@ import com.gmail.filoghost.holographicdisplays.util.DebugHandler;
import com.gmail.filoghost.holographicdisplays.util.ItemUtils;
import com.gmail.filoghost.holographicdisplays.util.ReflectionUtils;
import net.minecraft.server.v1_13_R1.AxisAlignedBB;
import net.minecraft.server.v1_13_R1.Blocks;
import net.minecraft.server.v1_13_R1.DamageSource;
import net.minecraft.server.v1_13_R1.Entity;
@ -35,6 +36,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = 32767; // Lock the item pickup delay, also prevents entities from picking up the item
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -111,6 +113,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return false;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -12,6 +12,7 @@ import com.gmail.filoghost.holographicdisplays.util.DebugHandler;
import com.gmail.filoghost.holographicdisplays.util.ItemUtils;
import com.gmail.filoghost.holographicdisplays.util.ReflectionUtils;
import net.minecraft.server.v1_8_R1.AxisAlignedBB;
import net.minecraft.server.v1_8_R1.Blocks;
import net.minecraft.server.v1_8_R1.DamageSource;
import net.minecraft.server.v1_8_R1.Entity;
@ -35,6 +36,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -95,6 +97,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return true;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -12,6 +12,7 @@ import com.gmail.filoghost.holographicdisplays.util.DebugHandler;
import com.gmail.filoghost.holographicdisplays.util.ItemUtils;
import com.gmail.filoghost.holographicdisplays.util.ReflectionUtils;
import net.minecraft.server.v1_8_R2.AxisAlignedBB;
import net.minecraft.server.v1_8_R2.Blocks;
import net.minecraft.server.v1_8_R2.DamageSource;
import net.minecraft.server.v1_8_R2.Entity;
@ -35,6 +36,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -95,6 +97,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return true;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -12,6 +12,7 @@ import com.gmail.filoghost.holographicdisplays.util.DebugHandler;
import com.gmail.filoghost.holographicdisplays.util.ItemUtils;
import com.gmail.filoghost.holographicdisplays.util.ReflectionUtils;
import net.minecraft.server.v1_8_R3.AxisAlignedBB;
import net.minecraft.server.v1_8_R3.Blocks;
import net.minecraft.server.v1_8_R3.DamageSource;
import net.minecraft.server.v1_8_R3.Entity;
@ -35,6 +36,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -95,6 +97,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return true;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -13,6 +13,7 @@ import com.gmail.filoghost.holographicdisplays.util.ItemUtils;
import com.gmail.filoghost.holographicdisplays.util.ReflectionUtils;
import com.gmail.filoghost.holographicdisplays.util.Utils;
import net.minecraft.server.v1_9_R1.AxisAlignedBB;
import net.minecraft.server.v1_9_R1.Blocks;
import net.minecraft.server.v1_9_R1.DamageSource;
import net.minecraft.server.v1_9_R1.Entity;
@ -39,6 +40,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -134,6 +136,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return false;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.

View File

@ -13,6 +13,7 @@ import com.gmail.filoghost.holographicdisplays.util.ItemUtils;
import com.gmail.filoghost.holographicdisplays.util.ReflectionUtils;
import com.gmail.filoghost.holographicdisplays.util.Utils;
import net.minecraft.server.v1_9_R2.AxisAlignedBB;
import net.minecraft.server.v1_9_R2.Blocks;
import net.minecraft.server.v1_9_R2.DamageSource;
import net.minecraft.server.v1_9_R2.Entity;
@ -39,6 +40,7 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
super.pickupDelay = Integer.MAX_VALUE;
this.parentPiece = piece;
this.itemPickupManager = itemPickupManager;
forceSetBoundingBox(new NullBoundingBox());
}
@Override
@ -135,6 +137,15 @@ public class EntityNMSItem extends EntityItem implements NMSItem {
return false;
}
@Override
public void a(AxisAlignedBB boundingBox) {
// Do not change it!
}
public void forceSetBoundingBox(AxisAlignedBB boundingBox) {
super.a(boundingBox);
}
@Override
public void inactiveTick() {
// Check inactive ticks.