Skip to content

Commit 8ed5382

Browse files
feat: ported to 1.19.4
1 parent 8c73c8c commit 8ed5382

File tree

9 files changed

+22
-25
lines changed

9 files changed

+22
-25
lines changed

gradle.properties

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
org.gradle.jvmargs=-Xmx3G
22
org.gradle.daemon=false
33
#Mod Info
4-
mod_version=1.14.1
4+
# I durped and released 1.15 for 1.20 and not 1.19.4 so I bumped the version range by 100 to avoid conflicts
5+
mod_version=1.14.100
56
#Dependencies
6-
mc_version=1.19.3
7-
forge_version=44.1.8
8-
jei_version=12.1.1.13
7+
mc_version=1.19.4
8+
forge_version=45.1.17
9+
jei_version=13.1.0.16

src/main/java/com/direwolf20/mininggadgets/client/events/EventRenderGadget.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import net.minecraft.client.renderer.ItemInHandRenderer;
1212
import net.minecraft.client.renderer.MultiBufferSource;
1313
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
14-
import net.minecraft.client.renderer.block.model.ItemTransforms;
14+
import net.minecraft.util.Mth;
1515
import net.minecraft.world.InteractionHand;
1616
import net.minecraft.world.entity.HumanoidArm;
17-
import net.minecraft.util.Mth;
17+
import net.minecraft.world.item.ItemDisplayContext;
1818
import net.minecraftforge.api.distmarker.Dist;
1919
import net.minecraftforge.client.event.RenderHandEvent;
2020
import net.minecraftforge.eventbus.api.SubscribeEvent;
@@ -88,8 +88,8 @@ public static void renderGadget(RenderHandEvent event) {
8888
firstPersonRenderer.renderItem(abstractclientplayerentity,
8989
event.getItemStack(),
9090
rightHand
91-
? ItemTransforms.TransformType.FIRST_PERSON_RIGHT_HAND
92-
: ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND,
91+
? ItemDisplayContext.FIRST_PERSON_RIGHT_HAND
92+
: ItemDisplayContext.FIRST_PERSON_LEFT_HAND,
9393
!rightHand,
9494
event.getPoseStack(),
9595
event.getMultiBufferSource(),

src/main/java/com/direwolf20/mininggadgets/client/particles/laserparticle/LaserParticle.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public LaserParticle(ClientLevel world, double d, double d1, double d2, double x
5252
// of the asset instead of it applying to the entire texture
5353
BlockColors blockColors = Minecraft.getInstance().getBlockColors();
5454

55-
int color = blockColors.getColor(this.blockState, this.level, new BlockPos(d, d1, d2), 0);
55+
int color = blockColors.getColor(this.blockState, this.level, new BlockPos((int) d, (int) d1, (int) d2), 0);
5656
float f = (float) (color >> 16 & 255) / 255.0F;
5757
float f1 = (float) (color >> 8 & 255) / 255.0F;
5858
float f2 = (float) (color & 255) / 255.0F;
@@ -80,8 +80,7 @@ public LaserParticle(ClientLevel world, double d, double d1, double d2, double x
8080
xo = x;
8181
yo = y;
8282
zo = z;
83-
RenderBlockTileEntity te = (RenderBlockTileEntity) world.getBlockEntity(new BlockPos(this.x, this.y, this.z));
84-
if (te != null) {
83+
if (world.getBlockEntity(new BlockPos((int)Math.floor(this.x), (int)Math.floor(this.y), (int)Math.floor(this.z))) instanceof RenderBlockTileEntity te) {
8584
playerUUID = te.getPlayerUUID();
8685
voiding = !te.getBlockAllowed();
8786
}
@@ -99,7 +98,7 @@ public void render(VertexConsumer builder, Camera activeRenderInfo, float partia
9998
public boolean particleToPlayer(Player player) {
10099
boolean partToPlayer = false;
101100
//if (player.isHandActive()) partToPlayer = true;
102-
BlockPos sourcePos = new BlockPos(sourceX, sourceY, sourceZ);
101+
BlockPos sourcePos = new BlockPos((int)Math.floor(sourceX), (int)Math.floor(sourceY), (int)Math.floor(sourceZ));
103102
if (!(level.getBlockState(sourcePos) == this.blockState)) partToPlayer = true;
104103
BlockEntity te = level.getBlockEntity(sourcePos);
105104
if (te != null && te instanceof RenderBlockTileEntity) {

src/main/java/com/direwolf20/mininggadgets/client/particles/playerparticle/PlayerParticle.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import com.direwolf20.mininggadgets.common.MiningGadgets;
44
import com.mojang.blaze3d.vertex.VertexConsumer;
5-
import net.minecraft.client.particle.SpriteSet;
6-
import net.minecraft.client.particle.ParticleRenderType;
7-
import net.minecraft.client.particle.TextureSheetParticle;
85
import net.minecraft.client.Camera;
96
import net.minecraft.client.multiplayer.ClientLevel;
7+
import net.minecraft.client.particle.ParticleRenderType;
8+
import net.minecraft.client.particle.SpriteSet;
9+
import net.minecraft.client.particle.TextureSheetParticle;
1010
import net.minecraft.resources.ResourceLocation;
11-
import net.minecraft.core.BlockPos;
1211
import net.minecraft.world.phys.Vec3;
1312

1413
import java.util.Random;
@@ -110,8 +109,6 @@ public void tick() {
110109
moveY = (targetY - this.y) / speedAdjust;
111110
moveZ = (targetZ - this.z) / speedAdjust;
112111

113-
BlockPos nextPos = new BlockPos(this.x + moveX, this.y + moveY, this.z + moveZ);
114-
115112
if (age > 40)
116113
//if (world.getBlockState(nextPos).getBlock() == ModBlocks.RENDERBLOCK)
117114
this.hasPhysics = false;

src/main/java/com/direwolf20/mininggadgets/client/renderer/ModificationShiftOverlay.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import com.mojang.math.Axis;
1010
import net.minecraft.client.Minecraft;
1111
import net.minecraft.client.renderer.MultiBufferSource;
12-
import net.minecraft.client.renderer.block.model.ItemTransforms;
1312
import net.minecraft.client.renderer.texture.OverlayTexture;
1413
import net.minecraft.client.resources.model.BakedModel;
1514
import net.minecraft.core.BlockPos;
1615
import net.minecraft.world.entity.player.Player;
16+
import net.minecraft.world.item.ItemDisplayContext;
1717
import net.minecraft.world.item.ItemStack;
1818
import net.minecraft.world.level.block.entity.BlockEntity;
1919
import net.minecraft.world.phys.BlockHitResult;
@@ -83,7 +83,7 @@ public static void render(RenderLevelStageEvent evt, Player player) {
8383
matrix.mulPose(Axis.XP.rotationDegrees(26));
8484
ItemStack upgradeStack = new ItemStack(upgrade.getCardItem().get());
8585
BakedModel model = Minecraft.getInstance().getItemRenderer().getModel(upgradeStack, Minecraft.getInstance().level, null, 0);
86-
Minecraft.getInstance().getItemRenderer().render(upgradeStack, ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND, false, matrix, outlineLayerBuffer, 15728880, OverlayTexture.NO_OVERLAY, model);
86+
Minecraft.getInstance().getItemRenderer().render(upgradeStack, ItemDisplayContext.FIRST_PERSON_LEFT_HAND, false, matrix, outlineLayerBuffer, 15728880, OverlayTexture.NO_OVERLAY, model);
8787
x += 1;
8888
if (x > 2) {
8989
x = 0;

src/main/java/com/direwolf20/mininggadgets/client/renderer/ModificationTableTER.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import com.mojang.math.Axis;
77
import net.minecraft.client.Minecraft;
88
import net.minecraft.client.renderer.MultiBufferSource;
9-
import net.minecraft.client.renderer.block.model.ItemTransforms;
109
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
1110
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
1211
import net.minecraft.client.resources.model.BakedModel;
1312
import net.minecraft.core.Direction;
13+
import net.minecraft.world.item.ItemDisplayContext;
1414
import net.minecraft.world.item.ItemStack;
1515
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
1616
import net.minecraftforge.common.capabilities.ForgeCapabilities;
@@ -57,7 +57,7 @@ public void render(ModificationTableTileEntity tile, float partialTicks, PoseSta
5757
}
5858

5959
BakedModel model = Minecraft.getInstance().getItemRenderer().getModel(stack, Minecraft.getInstance().level, null, 0);
60-
Minecraft.getInstance().getItemRenderer().render(stack, ItemTransforms.TransformType.FIRST_PERSON_LEFT_HAND, false, matrix,buffer, combinedLights, combinedOverlay, model);
60+
Minecraft.getInstance().getItemRenderer().render(stack, ItemDisplayContext.FIRST_PERSON_LEFT_HAND, false, matrix,buffer, combinedLights, combinedOverlay, model);
6161
matrix.popPose();
6262
}
6363
}

src/main/java/com/direwolf20/mininggadgets/client/screens/ModificationTableScreen.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ protected void drawPanel(PoseStack mStack, int entryRight, int relativeY, Tessel
143143

144144
int index = 0;
145145
for (Upgrade upgrade : this.parent.container.getUpgradesCache()) {
146-
Minecraft.getInstance().getItemRenderer().renderGuiItem(new ItemStack(upgrade.getCardItem().get()), x, y);
146+
Minecraft.getInstance().getItemRenderer().renderGuiItem(mStack, new ItemStack(upgrade.getCardItem().get()), x, y);
147147

148148
if( isMouseOver(mouseX, mouseY) && (mouseX > x && mouseX < x + 15 && mouseY > y && mouseY < y + 15) )
149149
currentUpgrade = upgrade;

src/main/java/com/direwolf20/mininggadgets/client/screens/widget/ToggleButton.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public ToggleButton(int xIn, int yIn, Component msg, ResourceLocation texture, P
3030
}
3131

3232
@Override
33-
public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) {
33+
public void renderWidget(PoseStack stack, int mouseX, int mouseY, float partialTicks) {
3434
Color activeColor = this.enabled ? Color.GREEN : Color.RED;
3535

3636
fill(stack, this.getX(), this.getY(), this.getX() + this.width, this.getY() + this.height, ((this.enabled ? 0x68000000 : 0x9B000000)) + activeColor.getRGB());

src/main/java/com/direwolf20/mininggadgets/common/MiningGadgets.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void buildContents(CreativeModeTabEvent.Register event) {
6969
event.registerCreativeModeTab(new ResourceLocation(MOD_ID, MOD_ID), builder ->
7070
builder.title(Component.translatable("itemGroup." + MOD_ID))
7171
.icon(() -> new ItemStack(ModItems.MININGGADGET_FANCY.get()))
72-
.displayItems((enabledFlags, populator, hasPermissions) -> {
72+
.displayItems((enabledFlags, populator) -> {
7373
ModItems.ITEMS.getEntries()
7474
.stream().filter(e -> e != ModItems.MINERS_LIGHT_ITEM)
7575
.forEach(e -> {

0 commit comments

Comments
 (0)