Skip to content

Commit

Permalink
25w05a
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Jan 30, 2025
1 parent b1a2e33 commit 6a77d6a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check https://fabricmc.net/develop/
minecraft_version=25w04a
minecraft_version=25w05a
loader_version=0.16.10
jsr305_version=3.0.2
fabric_version=0.110.5+1.21.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.client.renderer.blockentity.PistonHeadRenderer;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.piston.PistonMovingBlockEntity;
import net.minecraft.world.phys.Vec3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -27,8 +28,9 @@ private void onInitCM(BlockEntityRendererProvider.Context arguments, CallbackInf
}

@Inject(method = "render", at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/renderer/blockentity/PistonHeadRenderer;renderBlock(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/world/level/Level;ZI)V", ordinal = 3))
private void updateRenderBool(PistonMovingBlockEntity pistonBlockEntity_1, float float_1, PoseStack matrixStack_1, MultiBufferSource layeredVertexConsumerStorage_1, int int_1, int int_2, CallbackInfo ci)
target = "Lnet/minecraft/client/renderer/blockentity/PistonHeadRenderer;renderBlock(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/world/level/Level;ZI)V",
ordinal = 3))
private void updateRenderBool(PistonMovingBlockEntity pistonBlockEntity_1, float float_1, PoseStack matrixStack_1, MultiBufferSource layeredVertexConsumerStorage_1, int int_1, int int_2, Vec3 cameraPos, CallbackInfo ci)
//private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, class_4587 class_4587_1, class_4597 class_4597_1, int int_1, CallbackInfo ci)
{
if (!((PistonBlockEntityInterface) pistonBlockEntity_1).isRenderModeSet())
Expand All @@ -37,7 +39,7 @@ private void updateRenderBool(PistonMovingBlockEntity pistonBlockEntity_1, float


@Inject(method = "render", at = @At("RETURN"), locals = LocalCapture.NO_CAPTURE)
private void endMethod3576(PistonMovingBlockEntity pistonBlockEntity_1, float partialTicks, PoseStack matrixStack_1, MultiBufferSource layeredVertexConsumerStorage_1, int int_1, int init_2, CallbackInfo ci)
private void endMethod3576(PistonMovingBlockEntity pistonBlockEntity_1, float partialTicks, PoseStack matrixStack_1, MultiBufferSource layeredVertexConsumerStorage_1, int int_1, int init_2, Vec3 cameraPos, CallbackInfo ci)
{
if (((PistonBlockEntityInterface) pistonBlockEntity_1).getRenderCarriedBlockEntity())
{
Expand Down
37 changes: 34 additions & 3 deletions src/main/java/carpet/script/api/Scoreboards.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.Team;
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
import org.jetbrains.annotations.Nullable;

public class Scoreboards
{
Expand Down Expand Up @@ -420,7 +421,7 @@ public static void apply(Expression expression)
{
throw new InternalExpressionException("'team_property' requires a string as the third argument for the property " + propertyVal.getString());
}
Team.CollisionRule collisionRule = Team.CollisionRule.byName(settingVal.getString());
Team.CollisionRule collisionRule = getCollisionRule(settingVal);
if (collisionRule == null)
{
throw new InternalExpressionException("Unknown value for property " + propertyVal.getString() + ": " + settingVal.getString());
Expand Down Expand Up @@ -452,7 +453,7 @@ public static void apply(Expression expression)
{
throw new InternalExpressionException("'team_property' requires a string as the third argument for the property " + propertyVal.getString());
}
Team.Visibility deathMessageVisibility = Team.Visibility.byName(settingVal.getString());
Team.Visibility deathMessageVisibility = getVisibility(settingVal);
if (deathMessageVisibility == null)
{
throw new InternalExpressionException("Unknown value for property " + propertyVal.getString() + ": " + settingVal.getString());
Expand Down Expand Up @@ -490,7 +491,7 @@ public static void apply(Expression expression)
{
throw new InternalExpressionException("'team_property' requires a string as the third argument for the property " + propertyVal.getString());
}
Team.Visibility nametagVisibility = Team.Visibility.byName(settingVal.getString());
Team.Visibility nametagVisibility = getVisibility(settingVal);
if (nametagVisibility == null)
{
throw new InternalExpressionException("Unknown value for property " + propertyVal.getString() + ": " + settingVal.getString());
Expand Down Expand Up @@ -697,5 +698,35 @@ public static void apply(Expression expression)
}
});
}

@Nullable
private static Team.CollisionRule getCollisionRule(Value settingVal)
{

final String string = settingVal.getString();
for (Team.CollisionRule rule : Team.CollisionRule.values())
{
if (rule.getSerializedName().equalsIgnoreCase(string))
{
return rule;
}
}
return null;
}

@Nullable
private static Team.Visibility getVisibility(Value settingVal)
{

final String string = settingVal.getString();
for (Team.Visibility rule : Team.Visibility.values())
{
if (rule.getSerializedName().equalsIgnoreCase(string))
{
return rule;
}
}
return null;
}
}

2 changes: 1 addition & 1 deletion src/main/java/carpet/script/utils/ShapesRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void renderLines(PoseStack matrices, Tesselator tesselator, double cx, do
if (blockEntityRenderer != null)
{
blockEntityRenderer.render(BlockEntity, partialTick,
matrices, immediate, light, OverlayTexture.NO_OVERLAY);
matrices, immediate, light, OverlayTexture.NO_OVERLAY, camera1.getPosition());

}
}
Expand Down

0 comments on commit 6a77d6a

Please sign in to comment.