Skip to content

Commit

Permalink
fixes to the new paintbrush logic
Browse files Browse the repository at this point in the history
fixed a related crash on entity destruction, and a conflict between sneaking and not.
  • Loading branch information
EternalBlueFlame committed Jan 5, 2024
1 parent c698890 commit 7f4be14
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/train/common/api/EntityRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,6 @@ public boolean attackEntityFrom(DamageSource damagesource, float i) {
if (worldObj.isRemote || isDead) {
return true;
}
if(damagesource.getEntity() instanceof EntityPlayerMP){
if(((EntityPlayerMP) damagesource.getEntity()).getHeldItem().getItem() instanceof ItemPaintbrushThing){

}

}
if (damagesource.getEntity() instanceof EntityPlayer && !damagesource.isProjectile()) {
if (this instanceof IPassenger) {
if (canBeDestroyedByPlayer(damagesource)) return false;
Expand Down Expand Up @@ -1725,7 +1719,7 @@ public boolean interactFirst(EntityPlayer entityplayer) {
return true;
}

if (itemstack != null && itemstack.getItem() instanceof ItemPaintbrushThing) {
if (itemstack != null && itemstack.getItem() instanceof ItemPaintbrushThing && !entityplayer.isSneaking()) {
if (this.getSpec().getLiveries().size() > 0) {
entityplayer.openGui(Traincraft.instance, GuiIDs.PAINTBRUSH, entityplayer.getEntityWorld(), this.getEntityId(), -1, (int) this.posZ);
}
Expand Down

0 comments on commit 7f4be14

Please sign in to comment.