Skip to content

Commit 822d88a

Browse files
committed
1.21.11-start
1 parent 8e2bb55 commit 822d88a

24 files changed

+93
-80
lines changed

common/src/main/java/journeymap/api/v2/client/entity/WrappedEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import net.minecraft.core.BlockPos;
44
import net.minecraft.network.chat.Component;
5+
import net.minecraft.resources.Identifier;
56
import net.minecraft.resources.ResourceKey;
6-
import net.minecraft.resources.ResourceLocation;
77
import net.minecraft.world.entity.Entity;
88
import net.minecraft.world.level.Level;
99
import net.minecraft.world.level.biome.Biome;
@@ -42,7 +42,7 @@ public interface WrappedEntity
4242
* @return - resource location.
4343
*/
4444
@Nullable
45-
ResourceLocation getEntityIconLocation();
45+
Identifier getEntityIconLocation();
4646

4747
/**
4848
* If the entity is hostile
@@ -212,7 +212,7 @@ public interface WrappedEntity
212212
*
213213
* @param entityIconLocation - the resource location of the icon.
214214
*/
215-
void setEntityIconLocation(ResourceLocation entityIconLocation);
215+
void setEntityIconLocation(Identifier entityIconLocation);
216216

217217
/**
218218
* Sets the custom name of the entity.

common/src/main/java/journeymap/api/v2/client/fullscreen/CustomToolBarBuilder.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package journeymap.api.v2.client.fullscreen;
22

3-
import net.minecraft.resources.ResourceLocation;
3+
import net.minecraft.resources.Identifier;
44
import org.jetbrains.annotations.NotNull;
55

66
public interface CustomToolBarBuilder
@@ -10,42 +10,42 @@ public interface CustomToolBarBuilder
1010
*
1111
* @param labelOn - The on label, can be the display string or i18n key.
1212
* @param labelOff - The off label, can be the display string or i18n key.
13-
* @param icon - The icon name. Icon resourceLocation
13+
* @param icon - The icon name. Icon Identifier
1414
* @param onPress - The onpress action.
1515
* @return IThemeButton
1616
*/
17-
IThemeButton getThemeToggleButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull ResourceLocation icon, @NotNull IThemeButton.Action onPress);
17+
IThemeButton getThemeToggleButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull Identifier icon, @NotNull IThemeButton.Action onPress);
1818

1919
/**
2020
* Creates and gets a theme button with a separate on/off label.
2121
*
2222
* @param labelOn - The on label, can be the display string or i18n key.
2323
* @param labelOff - The off label, can be the display string or i18n key.
24-
* @param icon - The icon name. Icon resourceLocation
24+
* @param icon - The icon name. Icon Identifier
2525
* @param onPress - The onpress action.
2626
* @return IThemeButton
2727
*/
28-
IThemeButton getThemeButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull ResourceLocation icon, @NotNull IThemeButton.Action onPress);
28+
IThemeButton getThemeButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull Identifier icon, @NotNull IThemeButton.Action onPress);
2929

3030
/**
3131
* Creates and gets a theme toggle button with a separate on/off label.
3232
*
3333
* @param label - The label, can be the display string or i18n key.
34-
* @param icon - The icon name. Icon resourceLocation
34+
* @param icon - The icon name. Icon Identifier
3535
* @param onPress - The onpress action.
3636
* @return IThemeButton
3737
*/
38-
IThemeButton getThemeToggleButton(@NotNull String label, @NotNull ResourceLocation icon, @NotNull IThemeButton.Action onPress);
38+
IThemeButton getThemeToggleButton(@NotNull String label, @NotNull Identifier icon, @NotNull IThemeButton.Action onPress);
3939

4040
/**
4141
* Creates and gets a theme button with a separate on/off label.
4242
*
4343
* @param label - The label, can be the display string or i18n key.
44-
* @param icon - The icon name. Icon resourceLocation
44+
* @param icon - The icon name. Icon Identifier
4545
* @param onPress - The onpress action.
4646
* @return IThemeButton
4747
*/
48-
IThemeButton getThemeButton(@NotNull String label, @NotNull ResourceLocation icon, @NotNull IThemeButton.Action onPress);
48+
IThemeButton getThemeButton(@NotNull String label, @NotNull Identifier icon, @NotNull IThemeButton.Action onPress);
4949

5050

5151
/**
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package journeymap.api.v2.client.fullscreen;
22

3-
import net.minecraft.resources.ResourceLocation;
3+
import net.minecraft.resources.Identifier;
44
import org.jetbrains.annotations.NotNull;
55

66
public interface ThemeButtonDisplay
@@ -10,43 +10,43 @@ public interface ThemeButtonDisplay
1010
*
1111
* @param labelOn - The on label, can be the display string or i18n key.
1212
* @param labelOff - The off label, can be the display string or i18n key.
13-
* @param icon - The icon name. Icon resourceLocation
13+
* @param icon - The icon name. Icon Identifier
1414
* @param toggled - If button starts toggled.
1515
* @param onPress - The onpress action.
1616
* @return IThemeButton
1717
*/
18-
IThemeButton addThemeToggleButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull ResourceLocation icon, boolean toggled, @NotNull IThemeButton.Action onPress);
18+
IThemeButton addThemeToggleButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull Identifier icon, boolean toggled, @NotNull IThemeButton.Action onPress);
1919

2020
/**
2121
* Creates and adds a theme button with a separate on/off label to the toolbar.
2222
*
2323
* @param labelOn - The on label, can be the display string or i18n key.
2424
* @param labelOff - The off label, can be the display string or i18n key.
25-
* @param icon - The icon name. Icon resourceLocation
25+
* @param icon - The icon name. Icon Identifier
2626
* @param onPress - The onpress action.
2727
* @return IThemeButton
2828
*/
29-
IThemeButton addThemeButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull ResourceLocation icon, @NotNull IThemeButton.Action onPress);
29+
IThemeButton addThemeButton(@NotNull String labelOn, @NotNull String labelOff, @NotNull Identifier icon, @NotNull IThemeButton.Action onPress);
3030

3131
/**
3232
* Creates and adds a theme toggle button with a separate on/off label to the toolbar.
3333
*
3434
* @param label - The label, can be the display string or i18n key.
35-
* @param icon - The icon name. Icon resourceLocation
35+
* @param icon - The icon name. Icon Identifier
3636
* @param toggled - If button starts toggled.
3737
* @param onPress - The onpress action.
3838
* @return IThemeButton
3939
*/
40-
IThemeButton addThemeToggleButton(@NotNull String label, @NotNull ResourceLocation icon, boolean toggled, @NotNull IThemeButton.Action onPress);
40+
IThemeButton addThemeToggleButton(@NotNull String label, @NotNull Identifier icon, boolean toggled, @NotNull IThemeButton.Action onPress);
4141

4242
/**
4343
* Creates and adds a theme button with a separate on/off label to the toolbar.
4444
*
4545
* @param label - The label, can be the display string or i18n key.
46-
* @param icon - The icon name. Icon resourceLocation
46+
* @param icon - The icon name. Icon Identifier
4747
* @param onPress - The onpress action.
4848
* @return IThemeButton
4949
*/
50-
IThemeButton addThemeButton(@NotNull String label, @NotNull ResourceLocation icon, @NotNull IThemeButton.Action onPress);
50+
IThemeButton addThemeButton(@NotNull String label, @NotNull Identifier icon, @NotNull IThemeButton.Action onPress);
5151

5252
}

common/src/main/java/journeymap/api/v2/client/model/MapImage.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.google.gson.annotations.Since;
2626
import com.mojang.blaze3d.platform.NativeImage;
2727
import journeymap.api.v2.client.display.Displayable;
28-
import net.minecraft.resources.ResourceLocation;
28+
import net.minecraft.resources.Identifier;
2929

3030
import javax.annotation.Nullable;
3131

@@ -44,7 +44,7 @@ public final class MapImage
4444
private transient NativeImage image;
4545

4646
@Since(1.1)
47-
private ResourceLocation imageLocation;
47+
private Identifier imageLocation;
4848

4949
@Since(1.1)
5050
private Integer color = 0xffffff;
@@ -129,7 +129,7 @@ public MapImage(NativeImage image, int textureX, int textureY, int textureWidth,
129129
* @param textureWidth width of texture
130130
* @param textureHeight height of texture
131131
*/
132-
public MapImage(ResourceLocation imageLocation, int textureWidth, int textureHeight)
132+
public MapImage(Identifier imageLocation, int textureWidth, int textureHeight)
133133
{
134134
this(imageLocation, 0, 0, textureWidth, textureHeight, 0xffffff, 1f);
135135
}
@@ -147,7 +147,7 @@ public MapImage(ResourceLocation imageLocation, int textureWidth, int textureHei
147147
* @param color Sets a color tint (rgb) on the image. Use white (0xffffff) for no tint.
148148
* @param opacity opacity between 0 and 1
149149
*/
150-
public MapImage(ResourceLocation imageLocation, int textureX, int textureY, int textureWidth, int textureHeight, int color, float opacity)
150+
public MapImage(Identifier imageLocation, int textureX, int textureY, int textureWidth, int textureHeight, int color, float opacity)
151151
{
152152
this.imageLocation = imageLocation;
153153
this.textureX = textureX;
@@ -323,7 +323,7 @@ public int getTextureHeight()
323323
* @return the location
324324
*/
325325
@Nullable
326-
public ResourceLocation getImageLocation()
326+
public Identifier getImageLocation()
327327
{
328328
return imageLocation;
329329
}

common/src/main/java/journeymap/api/v2/client/model/ShapeProperties.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import com.google.common.base.Objects;
2525
import com.mojang.blaze3d.platform.NativeImage;
2626
import journeymap.api.v2.client.display.Displayable;
27-
import net.minecraft.resources.ResourceLocation;
27+
import net.minecraft.resources.Identifier;
2828
import org.jetbrains.annotations.Nullable;
2929

3030
/**
@@ -41,7 +41,7 @@ public class ShapeProperties
4141
private float strokeWidth = 2;
4242
private StrokePosition strokePosition = StrokePosition.CENTER;
4343
private NativeImage image;
44-
private ResourceLocation imageLocation;
44+
private Identifier imageLocation;
4545
private double texturePositionX = 0;
4646
private double texturePositionY = 0;
4747
private double textureScaleX = 1;
@@ -208,7 +208,7 @@ public ShapeProperties setImage(NativeImage image)
208208
* @return the location
209209
*/
210210
@Nullable
211-
public ResourceLocation getImageLocation()
211+
public Identifier getImageLocation()
212212
{
213213
return imageLocation;
214214
}
@@ -219,7 +219,7 @@ public ResourceLocation getImageLocation()
219219
* @param imageLocation the image location
220220
* @return this
221221
*/
222-
public ShapeProperties setImageLocation(ResourceLocation imageLocation)
222+
public ShapeProperties setImageLocation(Identifier imageLocation)
223223
{
224224
this.imageLocation = imageLocation;
225225
return this;

common/src/main/java/journeymap/api/v2/client/ui/component/LayeredScreen.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void display()
2323
this.backgroundScreen = this.minecraft.screen;
2424
this.minecraft.screen = this;
2525
this.added();
26-
this.init(minecraft, minecraft.getWindow().getGuiScaledWidth(), minecraft.getWindow().getGuiScaledHeight());
26+
super.init(minecraft.getWindow().getGuiScaledWidth(), minecraft.getWindow().getGuiScaledHeight());
2727
minecraft.getNarrator().saySystemNow(this.getNarrationMessage());
2828
}
2929
else
@@ -32,12 +32,25 @@ public void display()
3232
}
3333
}
3434

35+
/**
36+
* use the non-deprecated version instead
37+
*
38+
* @param minecraft
39+
* @param width
40+
* @param height
41+
*/
42+
@Deprecated(forRemoval = true)
3543
public void resize(Minecraft minecraft, int width, int height)
3644
{
37-
super.resize(minecraft, width, height);
45+
this.resize(width, height);
46+
}
47+
48+
public void resize(int width, int height)
49+
{
50+
super.resize(width, height);
3851
if (this.backgroundScreen != null)
3952
{
40-
this.backgroundScreen.resize(this.minecraft, this.width, this.height);
53+
this.backgroundScreen.resize(this.width, this.height);
4154
}
4255
}
4356

common/src/main/java/journeymap/api/v2/common/waypoint/Waypoint.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package journeymap.api.v2.common.waypoint;
22

33
import net.minecraft.core.BlockPos;
4+
import net.minecraft.resources.Identifier;
45
import net.minecraft.resources.ResourceKey;
5-
import net.minecraft.resources.ResourceLocation;
66
import net.minecraft.world.level.Level;
77
import org.jetbrains.annotations.Nullable;
88

@@ -72,7 +72,7 @@ public interface Waypoint
7272

7373
default void setPrimaryDimension(ResourceKey<Level> dimension)
7474
{
75-
setPrimaryDimension(dimension.location().toString());
75+
setPrimaryDimension(dimension.identifier().toString());
7676
}
7777

7878
void setPrimaryDimension(String dimension);
@@ -171,16 +171,16 @@ default void setPrimaryDimension(ResourceKey<Level> dimension)
171171
/**
172172
* Gets the texture resource location.
173173
*
174-
* @return - ResourceLocation
174+
* @return - Identifier
175175
*/
176-
ResourceLocation getIconResourceLocation();
176+
Identifier getIconIdentifier();
177177

178178
/**
179179
* Sets the texture resource location.
180180
*
181-
* @param resourceLocation - the resource location
181+
* @param Identifier - the resource location
182182
*/
183-
void setIconResourceLoctaion(ResourceLocation resourceLocation);
183+
void setIconResourceLoctaion(Identifier Identifier);
184184

185185
/**
186186
* Gets the image textureWidth.

common/src/main/java/journeymap/api/v2/common/waypoint/WaypointFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ private static WaypointFactory getInstance()
4141
*/
4242
public static Waypoint createClientWaypoint(String modId, BlockPos pos, @Nullable String name, ResourceKey<Level> primaryDimension, boolean persistent)
4343
{
44-
return createClientWaypoint(modId, pos, name, primaryDimension.location().toString(), persistent);
44+
return createClientWaypoint(modId, pos, name, primaryDimension.identifier().toString(), persistent);
4545
}
4646

4747
public static Waypoint createClientWaypoint(String modId, BlockPos pos, ResourceKey<Level> primaryDimension, boolean persistent)
4848
{
49-
return createClientWaypoint(modId, pos, primaryDimension.location().toString(), persistent);
49+
return createClientWaypoint(modId, pos, primaryDimension.identifier().toString(), persistent);
5050
}
5151

5252
public static Waypoint createClientWaypoint(String modId, BlockPos pos, String primaryDimension, boolean persistent)

common/src/main/java/journeymap/api/v2/common/waypoint/WaypointGroup.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package journeymap.api.v2.common.waypoint;
22

3-
import net.minecraft.resources.ResourceLocation;
3+
import net.minecraft.resources.Identifier;
44
import org.jetbrains.annotations.Nullable;
55

66
import java.util.List;
@@ -182,16 +182,16 @@ public interface WaypointGroup
182182
/**
183183
* Gets the texture resource location.
184184
*
185-
* @return - ResourceLocation
185+
* @return - Identifier
186186
*/
187-
ResourceLocation getIconResourceLocation();
187+
Identifier getIconIdentifier();
188188

189189
/**
190190
* Sets the texture resource location.
191191
*
192-
* @param resourceLocation - the resource location
192+
* @param Identifier - the resource location
193193
*/
194-
void setIconResourceLoctaion(ResourceLocation resourceLocation);
194+
void setIconResourceLoctaion(Identifier Identifier);
195195

196196
/**
197197
* Gets the image textureWidth.

fabric/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.11-SNAPSHOT'
2+
id 'fabric-loom' version '1.13-SNAPSHOT'
33
id "idea"
44
id "maven-publish"
55
}

0 commit comments

Comments
 (0)