Skip to content

Commit

Permalink
Update to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
PepperCode1 committed Jun 8, 2022
1 parent 9686d62 commit d9c0561
Show file tree
Hide file tree
Showing 32 changed files with 65 additions and 66 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ dependencies {
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation('com.terraformersmc:modmenu:3.2.2') {
modImplementation('com.terraformersmc:modmenu:4.0.0') {
exclude group: 'net.fabricmc.fabric-api'
}

modCompileOnly 'maven.modrinth:sodium:mc1.18.2-0.4.1'
modCompileOnly 'maven.modrinth:sodium:mc1.19-0.4.2'
modCompileOnly 'io.vram:canvas-fabric-mc118:1.0.2308'
modCompileOnly 'maven.modrinth:indium:1.0.3+mc1.18.2'
}
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ org.gradle.jvmargs = -Xmx1G

# Fabric Properties
loom_version = 0.12-SNAPSHOT
minecraft_version = 1.18.2
yarn_mappings = 1.18.2+build.3
minecraft_version = 1.19
yarn_mappings = 1.19+build.1
loader_version = 0.14.6

# Mod Properties
mod_version = 2.0.0
mod_minecraft_version = 1.18.2
mod_minecraft_version = 1.19
maven_group = me.pepperbell
archives_base_name = continuity

# Dependencies
fabric_version = 0.55.1+1.18.2
fabric_version = 0.55.1+1.19
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.api.client;

import java.util.Random;
import java.util.function.Consumer;
import java.util.function.Supplier;

Expand All @@ -10,6 +9,7 @@
import net.minecraft.block.BlockState;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public interface QuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package me.pepperbell.continuity.client.config;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ScreenTexts;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.StringVisitable;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;

public class ContinuityConfigScreen extends Screen {
private final Screen parent;
private final ContinuityConfig config;

public ContinuityConfigScreen(Screen parent, ContinuityConfig config) {
super(new TranslatableText(getTranslationKey("title")));
super(Text.translatable(getTranslationKey("title")));
this.parent = parent;
this.config = config;
}
Expand Down Expand Up @@ -61,8 +60,8 @@ private ButtonWidget.TooltipSupplier createDefaultTooltipSupplier(StringVisitabl

private ButtonWidget createBooleanOptionButton(int x, int y, int width, int height, Option<Boolean> option) {
String translationKey = getTranslationKey(option.getKey());
Text text = new TranslatableText(translationKey);
Text tooltipText = new TranslatableText(getTooltipKey(translationKey));
Text text = Text.translatable(translationKey);
Text tooltipText = Text.translatable(getTooltipKey(translationKey));
return new ButtonWidget(x, y, width, height, ScreenTexts.composeToggleText(text, option.get()),
button -> {
boolean newValue = !option.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

@Mixin(FallingBlockEntityRenderer.class)
public class FallingBlockEntityRendererMixin {
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLjava/util/Random;JI)Z"))
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V"))
private void beforeRenderModel(FallingBlockEntity fallingBlockEntity, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
ContinuityFeatureStates states = ContinuityFeatureStates.get();
states.getConnectedTexturesState().disable();
states.getEmissiveTexturesState().disable();
}

@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLjava/util/Random;JI)Z", shift = At.Shift.AFTER))
@Inject(method = "render(Lnet/minecraft/entity/FallingBlockEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockModelRenderer;render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V", shift = At.Shift.AFTER))
private void afterRenderModel(FallingBlockEntity fallingBlockEntity, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
ContinuityFeatureStates states = ContinuityFeatureStates.get();
states.getConnectedTexturesState().enable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,14 @@ private void onTailInit(ResourceType type, List<ResourcePack> packs, CallbackInf
}
}

@ModifyVariable(method = "getResource(Lnet/minecraft/util/Identifier;)Lnet/minecraft/resource/Resource;", at = @At("HEAD"))
@ModifyVariable(method = "getResource(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;", at = @At("HEAD"))
private Identifier redirectGetResourceId(Identifier id) {
if (redirectHandler != null) {
return redirectHandler.redirect(id);
}
return id;
}

@ModifyVariable(method = "containsResource(Lnet/minecraft/util/Identifier;)Z", at = @At("HEAD"))
private Identifier redirectContainsResourceId(Identifier id) {
if (redirectHandler != null) {
return redirectHandler.redirect(id);
}
return id;
}

@ModifyVariable(method = "getAllResources(Lnet/minecraft/util/Identifier;)Ljava/util/List;", at = @At("HEAD"))
private Identifier redirectGetAllResourcesId(Identifier id) {
if (redirectHandler != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void onTailLoadSprites(ResourceManager resourceManager, Set<Identifier>
if (!id.getPath().endsWith(emissiveSuffix)) {
Identifier emissiveId = new Identifier(id.getNamespace(), id.getPath() + emissiveSuffix);
Identifier emissiveLocation = getTexturePath(emissiveId);
if (resourceManager.containsResource(emissiveLocation)) {
if (resourceManager.getResource(emissiveLocation).isPresent()) {
emissiveIds.add(emissiveId);
emissiveIdMap.put(id, emissiveId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.pepperbell.continuity.client.model;

import java.util.List;
import java.util.Random;
import java.util.function.Supplier;

import org.jetbrains.annotations.Nullable;
Expand All @@ -17,6 +16,7 @@
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class CTMBakedModel extends ForwardingBakedModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.model;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.EmissiveSpriteApi;
Expand All @@ -21,6 +20,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class EmissiveBakedModel extends ForwardingBakedModel {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package me.pepperbell.continuity.client.processor;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
import net.fabricmc.fabric.api.renderer.v1.mesh.MutableQuadView;
import net.minecraft.block.BlockState;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public abstract class AbstractQuadProcessor implements QuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public String get(BlockRenderView blockView, BlockPos pos) {
BlockEntity blockEntity = blockView.getBlockEntity(pos);
if (blockEntity instanceof Nameable nameable) {
if (nameable.hasCustomName()) {
blockEntityName = nameable.getCustomName().asString();
blockEntityName = nameable.getCustomName().getString();
} else {
blockEntityName = null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.pepperbell.continuity.client.processor;

import java.util.List;
import java.util.Random;
import java.util.function.Function;
import java.util.function.Supplier;

Expand Down Expand Up @@ -29,6 +28,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class CompactCTMQuadProcessor extends ConnectingQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
Expand All @@ -11,6 +10,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class HorizontalQuadProcessor extends ConnectingQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
Expand All @@ -11,6 +10,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class HorizontalVerticalQuadProcessor extends HorizontalQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
Expand All @@ -12,6 +11,7 @@
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class TopQuadProcessor extends ConnectingQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
Expand All @@ -11,6 +10,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class VerticalHorizontalQuadProcessor extends VerticalQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
Expand All @@ -11,6 +10,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class VerticalQuadProcessor extends ConnectingQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.pepperbell.continuity.client.processor.overlay;

import java.util.List;
import java.util.Random;
import java.util.function.Consumer;
import java.util.function.Supplier;

Expand All @@ -24,6 +23,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class SimpleOverlayQuadProcessor extends SimpleQuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.pepperbell.continuity.client.processor.overlay;

import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;
Expand Down Expand Up @@ -31,6 +30,7 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;
import net.minecraft.world.EmptyBlockView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor.simple;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.ProcessingDataProvider;
Expand All @@ -13,6 +12,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class CTMSpriteProvider implements SpriteProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor.simple;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.ProcessingDataProvider;
Expand All @@ -9,6 +8,7 @@
import net.minecraft.block.BlockState;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class FixedSpriteProvider implements SpriteProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor.simple;

import java.util.Random;
import java.util.function.Supplier;

import it.unimi.dsi.fastutil.HashCommon;
Expand All @@ -16,6 +15,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class RandomSpriteProvider implements SpriteProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor.simple;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.ProcessingDataProvider;
Expand All @@ -11,6 +10,7 @@
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class RepeatSpriteProvider implements SpriteProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor.simple;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.QuadProcessor;
Expand All @@ -14,6 +13,7 @@
import net.minecraft.block.BlockState;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public class SimpleQuadProcessor implements QuadProcessor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.pepperbell.continuity.client.processor.simple;

import java.util.Random;
import java.util.function.Supplier;

import me.pepperbell.continuity.api.client.ProcessingDataProvider;
Expand All @@ -9,6 +8,7 @@
import net.minecraft.block.BlockState;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;

public interface SpriteProvider {
Expand Down
Loading

0 comments on commit d9c0561

Please sign in to comment.