Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/aws404/easy-painter
Browse files Browse the repository at this point in the history
  • Loading branch information
aws404 committed Jun 14, 2021
2 parents a855aa5 + 6b61616 commit 9db24bc
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "0.8.12"
id "fabric-loom" version "0.8-SNAPSHOT"
id 'maven-publish'
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

# Fabric Versions
minecraft_version=1.17
yarn_mappings=1.17+build.5
loader_version=0.11.3
fabric_version=0.34.9+1.17
yarn_mappings=1.17+build.11
loader_version=0.11.6
fabric_version=0.35.1+1.17

# Dependency Versions
sgui_version=1.0.0-pre0-1.17-pre1
server_translations_version=1.4.2+1.17
server_translations_version=1.4.4+1.17

# Mod Properties
mod_version = 1.0.2
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/io/github/aws404/easypainter/EasyPainter.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.fabricmc.fabric.api.tag.TagRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
Expand All @@ -22,7 +23,6 @@
import net.minecraft.tag.Tag;
import net.minecraft.text.LiteralText;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
Expand All @@ -49,6 +49,8 @@ public class EasyPainter implements ModInitializer {

@Override
public void onInitialize() {
LOGGER.info("Starting Easy Painter (Version {})", FabricLoader.getInstance().getModContainer("easy_painter").orElseThrow(() -> new IllegalStateException("initialising unloaded mod")).getMetadata().getVersion().getFriendlyString());

CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> EasyPainterCommand.register(dispatcher));

ServerWorldEvents.LOAD.register((server, world) -> {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/io/github/aws404/easypainter/PaintingItem.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.github.aws404.easypainter;

import fr.catcore.server.translations.api.ServerTranslations;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.decoration.AbstractDecorationEntity;
import net.minecraft.entity.decoration.painting.PaintingEntity;
import net.minecraft.entity.decoration.painting.PaintingMotive;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.util.registry.Registry;
import org.apache.commons.lang3.StringUtils;

import java.util.Comparator;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package io.github.aws404.easypainter.command;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import io.github.aws404.easypainter.custom.MotiveCacheState;
import net.minecraft.command.CommandException;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.command.SetBlockCommand;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import net.minecraft.world.PersistentStateManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package io.github.aws404.easypainter.mixin;

import net.minecraft.item.map.MapState;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(MapState.class)
public interface MapStateAccessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void tick() {

@Inject(method = "readCustomDataFromNbt", at = @At("HEAD"))
private void readCustomDataFromNbt(NbtCompound nbt, CallbackInfo ci) {
this.locked = nbt.getBoolean("locked");
this.locked = nbt.contains("locked") && nbt.getBoolean("locked");
}

@Inject(method = "writeCustomDataToNbt", at = @At("HEAD"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.github.aws404.easypainter.mixin;

import io.github.aws404.easypainter.EasyPainter;
import net.minecraft.resource.ResourceManager;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ServerResourceManager;
import net.minecraft.server.command.CommandManager;
import net.minecraft.util.Unit;
Expand Down

0 comments on commit 9db24bc

Please sign in to comment.