Fixed rendering issue.

This commit is contained in:
stfwi 2022-01-18 17:16:55 +01:00
parent 82c2484872
commit d31cedfea1
5 changed files with 16 additions and 13 deletions

View file

@ -4,4 +4,4 @@ org.gradle.jvmargs=-Xmx8G
version_minecraft=1.18.1
version_forge_minecraft=1.18.1-39.0.5
version_jei=1.18.1:9.1.2.54
version_engineersdecor=1.1.19-b2
version_engineersdecor=1.1.19-b3

View file

@ -1,6 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"1.18.1": {
"1.1.19-b3": "[F] Fixed rendering issue.",
"1.1.19-b2": "[F] Fixed waterlogging.\n[F] Block entity parent saving corrected, ticker unified.\n[U] Forge/gradle update.",
"1.1.19-b1": "[U] Initial 1.18.1 port.",
"1.1.18": "[F] Block Placer placement context issue fix.\n[F] Fixed compatibility to Forge >=37.0.82.\n[M] Update lang ru_ru (PR#191, Smollet777).",
@ -49,6 +50,6 @@
},
"promos": {
"1.18.1-recommended": "1.1.18",
"1.18.1-latest": "1.1.19-b2"
"1.18.1-latest": "1.1.19-b3"
}
}

View file

@ -11,6 +11,8 @@ Mod sources for Minecraft version 1.18.x.
## Version history
- v1.1.19-b3 [F] Fixed rendering issue.
- v1.1.19-b2 [F] Fixed waterlogging.
[F] Block entity parent saving corrected, ticker unified.
[U] Forge/gradle update.

View file

@ -24,6 +24,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -71,7 +72,7 @@ public class ModRenderers
@OnlyIn(Dist.CLIENT)
public static class CraftingTableTer implements BlockEntityRenderer<EdCraftingTable.CraftingTableTileEntity>
{
private static int tesr_error_counter = 4;
private static int tesr_error_counter = 16;
private static final float scaler = 0.1f;
private static final float gap = 0.19f;
private static final float[] yrotations = {0, 90, 180, 270}; // [hdirection] S-W-N-E
@ -92,7 +93,9 @@ public class ModRenderers
{
if(tesr_error_counter <= 0) return;
try {
final int di = Mth.clamp(te.getLevel().getBlockState(te.getBlockPos()).getValue(CraftingTableBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3);
final BlockState state = te.getLevel().getBlockState(te.getBlockPos());
if(!(state.getBlock() instanceof EdCraftingTable.CraftingTableBlock)) return;
final int di = Mth.clamp(state.getValue(CraftingTableBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3);
long posrnd = te.getBlockPos().asLong();
posrnd = (posrnd>>16)^(posrnd<<1);
for(int i=0; i<9; ++i) {
@ -150,7 +153,9 @@ public class ModRenderers
try {
final ItemStack stack = te.getItemFrameStack();
if(stack.isEmpty()) return;
final int di = Mth.clamp(te.getLevel().getBlockState(te.getBlockPos()).getValue(EdLabeledCrate.LabeledCrateBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3);
final BlockState state = te.getLevel().getBlockState(te.getBlockPos());
if(!(state.getBlock() instanceof EdLabeledCrate.LabeledCrateBlock)) return;
final int di = Mth.clamp(state.getValue(EdLabeledCrate.LabeledCrateBlock.HORIZONTAL_FACING).get2DDataValue(), 0, 3);
double ox = tr[di][0], oy = tr[di][1], oz = tr[di][2];
float ry = (float)tr[di][3];
mxs.pushPose();

View file

@ -209,12 +209,7 @@ public class StandardBlocks
{ this(conf, properties, Arrays.stream(aabbs).map(Shapes::create).reduce(Shapes.empty(), (shape, aabb)->Shapes.joinUnoptimized(shape, aabb, BooleanOp.OR))); }
public Cutout(long conf, BlockBehaviour.Properties properties, VoxelShape voxel_shape)
{
super(conf, properties);
vshape = voxel_shape;
BlockState state = getStateDefinition().any();
registerDefaultState(state);
}
{ super(conf, properties); vshape = voxel_shape; }
@Override
@SuppressWarnings("deprecation")
@ -304,7 +299,7 @@ public class StandardBlocks
public Directed(long config, BlockBehaviour.Properties properties, final Function<List<BlockState>, Map<BlockState,VoxelShape>> shape_supplier)
{
super(config, properties);
registerDefaultState(stateDefinition.any().setValue(FACING, Direction.UP));
registerDefaultState(super.defaultBlockState().setValue(FACING, Direction.UP));
vshapes = shape_supplier.apply(getStateDefinition().getPossibleStates());
}
@ -459,7 +454,7 @@ public class StandardBlocks
public Horizontal(long config, BlockBehaviour.Properties properties, final Function<List<BlockState>, Map<BlockState,VoxelShape>> shape_supplier)
{
super(config|CFG_HORIZIONTAL, properties);
registerDefaultState(stateDefinition.any().setValue(HORIZONTAL_FACING, Direction.NORTH));
registerDefaultState(super.defaultBlockState().setValue(HORIZONTAL_FACING, Direction.NORTH));
vshapes = shape_supplier.apply(getStateDefinition().getPossibleStates());
cshapes = shape_supplier.apply(getStateDefinition().getPossibleStates());
}