diff --git a/build.gradle b/build.gradle index 5053b20..659a6c7 100755 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ if(rootProject.file('private.gradle').exists()) { //Publishing details archivesBaseName = "templates" group = "io.github.cottonmc" -version = "1.0.4+1.14.3" +version = "1.0.5+1.14.3" minecraft { refmapName = 'mixins.templates.refmap.json' diff --git a/src/main/java/io/github/cottonmc/templates/block/TemplateBlock.java b/src/main/java/io/github/cottonmc/templates/block/TemplateBlock.java index c207f26..cfa5d20 100644 --- a/src/main/java/io/github/cottonmc/templates/block/TemplateBlock.java +++ b/src/main/java/io/github/cottonmc/templates/block/TemplateBlock.java @@ -42,7 +42,7 @@ public abstract class TemplateBlock extends Block implements BlockEntityProvider } ItemPlacementContext ctx = new ItemPlacementContext(new ItemUsageContext(player, hand, hit)); BlockState placementState = block.getPlacementState(ctx); - if (state.isSimpleFullBlock(world, pos) && !(block instanceof BlockEntityProvider)) { + if (Block.isShapeFullCube(state.getCollisionShape(world, pos)) && !(block instanceof BlockEntityProvider)) { if (be.getRenderedState().getBlock() == Blocks.AIR) { be.setRenderedState(placementState); if (!player.abilities.creativeMode) stack.decrement(1); diff --git a/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java b/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java index eb492aa..6d12508 100644 --- a/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java +++ b/src/main/java/io/github/cottonmc/templates/util/SpriteSet.java @@ -3,6 +3,7 @@ package io.github.cottonmc.templates.util; import java.util.List; import java.util.Random; +import net.minecraft.client.texture.MissingSprite; import org.apache.commons.lang3.ObjectUtils; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; @@ -17,7 +18,8 @@ import net.minecraft.util.math.Direction; public class SpriteSet { private Object2ObjectOpenHashMap quads = new Object2ObjectOpenHashMap<>(); private boolean isDefault = true; - public static final Sprite FALLBACK = MinecraftClient.getInstance().getSpriteAtlas().getSprite(new Identifier("minecraft:block/scaffolding_top")); + public static final Sprite DEFAULT = MinecraftClient.getInstance().getSpriteAtlas().getSprite(new Identifier("minecraft:block/scaffolding_top")); + public static final Sprite FALLBACK = MissingSprite.getMissingSprite(); public SpriteSet() { clear(); @@ -43,7 +45,10 @@ public class SpriteSet { } public Sprite getSprite(Direction dir) { - return isDefault ? FALLBACK : ObjectUtils.defaultIfNull(quads.get(dir).getSprite(), FALLBACK); + if (isDefault) return DEFAULT; + BakedQuad quad = quads.get(dir); + if (quad == null) return FALLBACK; + return quad.getSprite(); } public boolean hasColor(Direction dir) {