mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-09 19:44:40 +01:00
Improve glue behavior. Glue can no longer place on torch or so on
This commit is contained in:
parent
2a9795f411
commit
1578a2ac68
2 changed files with 6 additions and 3 deletions
|
@ -13,6 +13,7 @@ import com.simibubi.create.modules.schematics.ISpecialEntityItemRequirement;
|
|||
import com.simibubi.create.modules.schematics.ItemRequirement;
|
||||
import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
|
@ -164,11 +165,13 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat
|
|||
}
|
||||
|
||||
public static boolean isValidFace(World world, BlockPos pos, Direction direction) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (BlockMovementTraits.isBlockAttachedTowards(state, direction))
|
||||
return true;
|
||||
if (!BlockMovementTraits.movementNecessary(world, pos))
|
||||
return false;
|
||||
if (BlockMovementTraits.notSupportive(world.getBlockState(pos), direction)) {
|
||||
if (BlockMovementTraits.notSupportive(state, direction))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class SuperGlueRenderer extends EntityRenderer<SuperGlueEntity> {
|
|||
return false;
|
||||
BlockPos pos = entity.hangingPosition;
|
||||
BlockPos pos2 = pos.offset(entity.getFacingDirection().getOpposite());
|
||||
return !SuperGlueEntity.isValidFace(entity.world, pos2, entity.getFacingDirection()) || !SuperGlueEntity.isValidFace(entity.world, pos, entity.getFacingDirection().getOpposite());
|
||||
return SuperGlueEntity.isValidFace(entity.world, pos2, entity.getFacingDirection()) != SuperGlueEntity.isValidFace(entity.world, pos, entity.getFacingDirection().getOpposite());
|
||||
}
|
||||
|
||||
private void initQuads() {
|
||||
|
|
Loading…
Reference in a new issue