Fabricization#4
Conversation
| import net.minecraft.server.command.CommandSource; | ||
| import net.minecraft.text.LiteralText; | ||
|
|
||
| public class EnumArgumentType<E extends Enum<E>> implements ArgumentType<E> { |
There was a problem hiding this comment.
Yeah this needs to go since we don't use it anymore
| @@ -1,7 +1,14 @@ | |||
| Copyright 2019 Martmists | |||
| Copyright 2020 FabLabsMC | |||
There was a problem hiding this comment.
Not sure we can keep this in FabLabs, then.
| targetCompatibility = 1.8 | ||
|
|
||
| // Elytra version format - notes branch, commit count, and dirty in version string | ||
| def branch |
There was a problem hiding this comment.
This needs cleaning up
| @@ -0,0 +1,196 @@ | |||
| <?xml version="1.0"?> | |||
There was a problem hiding this comment.
No need for checkstyle enforcing
There was a problem hiding this comment.
If this is meant to be merged into Fabric API, then it needs checkstyle enforcing. If it's not meant to be merged into Fabric API, then it shouldn't be here.
| zipStorePath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip |
There was a problem hiding this comment.
Why has this been downgraded? Revert.
|
|
||
| # Mod Properties | ||
| # library_name may also be used for maven publishing | ||
| mod_version = 1.0.0 |
There was a problem hiding this comment.
Versioning should stay consistent with existing versioning
| } | ||
|
|
||
| @Override | ||
| public GameRules.RuleType<GameRules.IntRule> createBoundedIntType(int defaultValue, int lowerBound, int upperBound, BiConsumer<MinecraftServer, GameRules.IntRule> notifier) { |
There was a problem hiding this comment.
Should be a function overload with createIntType instead
| } | ||
|
|
||
| @Override | ||
| public GameRules.RuleType<GameRules.BooleanRule> createBooleanType(boolean defaultValue, BiConsumer<MinecraftServer, GameRules.BooleanRule> notifier) { |
There was a problem hiding this comment.
all these methods should be called createXXXRuleType instead
|
|
||
| import net.fabricmc.api.ModInitializer; | ||
|
|
||
| public class GameRuleTest implements ModInitializer { |
There was a problem hiding this comment.
This needs to be removed
| @@ -0,0 +1,4 @@ | |||
| accessWidener v1 named | |||
There was a problem hiding this comment.
Not sure what this file is used for but seems to be just docs, should be removed
There was a problem hiding this comment.
This isn't docs, this is essential. Access Wideners mean we don't need to dance around private classes.
| @@ -1,39 +0,0 @@ | |||
| package com.martmists.libgamerule.compat.libcd; | |||
There was a problem hiding this comment.
LibCD tweakers should still be implemented
This PR refactors much of LibGameRule to meet the API standards set for fabric's api. Namely things have been changed where GameRule types are created in the
RuleFactoryand are registered in theGameRuleRegistry.This also adds a new
TextRulewhich storesText.Other new tweaks such as now using brigadier's literals for enum rules so vanilla clients need not worry about missing argument types.
Of course this isn't complete yet, this is here to measure the progress towards a library of high enough quality to PR into fabric's API.
One issue is FabricMC/fabric-loom#193 where we can't use an invoker for creation of regular RuleTypes, but the workaround for this could stay.