diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..a40feaeb38
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,25 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+tab_width = 4
+
+[*.gradle]
+indent_style = tab
+
+[*.java]
+indent_style = tab
+
+[*.json]
+indent_style = space
+indent_size = 2
+
+[*.properties]
+indent_style = space
+indent_size = 2
+
+[.editorconfig]
+indent_style = space
+indent_size = 4
diff --git a/HEADER b/HEADER
index 06e5a0ab0c..d5f99faa4d 100644
--- a/HEADER
+++ b/HEADER
@@ -1,4 +1,4 @@
-Copyright (c) 2016, 2017, 2018 FabricMC
+Copyright (c) 2016, 2017, 2018, 2019 FabricMC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/build.gradle b/build.gradle
index de266f0432..cb2951599f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,6 +4,7 @@ plugins {
id 'idea'
id 'maven-publish'
id 'fabric-loom' version '0.2.2-SNAPSHOT' apply false
+ id 'net.minecrell.licenser' version '0.4.1'
// id 'com.matthewprenger.cursegradle' version "1.1.2"
}
@@ -15,6 +16,7 @@ def mcVersion = "1.14"
allprojects {
apply plugin: 'maven-publish'
apply plugin: 'fabric-loom'
+ apply plugin: 'net.minecrell.licenser'
sourceCompatibility = 1.8
targetCompatibility = 1.8
@@ -52,6 +54,12 @@ allprojects {
exclude "fabric.mod.json"
}
}
+
+ license {
+ println(rootProject.file('HEADER'))
+ header rootProject.file('HEADER')
+ include '**/*.java'
+ }
}
task sourcesJar(type: Jar, dependsOn: classes) {
@@ -119,7 +127,7 @@ publishing {
def depNode = depsNode.appendNode("dependency")
depNode.appendNode("groupId", it.group)
depNode.appendNode("artifactId", it.name)
- depNode.appendNode("version", it.version)
+ depNode.appendNode("version", it.version)
depNode.appendNode("scope", "compile")
}
}
@@ -139,6 +147,9 @@ publishing {
}
}
+task licenseFormatAll
+subprojects { p -> licenseFormatAll.dependsOn("${p.path}:licenseFormat") }
+
dependencies {
afterEvaluate {
subprojects.each {
@@ -171,5 +182,4 @@ version = baseVersion + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER)
// }
//}
-apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.gradle'
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/FabricKeyBinding.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/FabricKeyBinding.java
index 81c2a63972..eba789ee01 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/FabricKeyBinding.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/FabricKeyBinding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
/**
* Expanded version of {@link KeyBinding} for use by Fabric mods.
- *
+ *
* *ALL* instantiated FabricKeyBindings should be registered in
* {@link KeyBindingRegistry#register(FabricKeyBinding)}!
*/
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/KeyBindingRegistry.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/KeyBindingRegistry.java
index aa66322e91..213fc8ee35 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/KeyBindingRegistry.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/keybinding/KeyBindingRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ public interface KeyBindingRegistry {
/**
* Add a new key binding category.
+ *
* @param categoryName The key binding category name.
* @return True if a new category was added.
*/
@@ -36,6 +37,7 @@ public interface KeyBindingRegistry {
/**
* Register a new key binding.
+ *
* @param binding The key binding.
* @return True if a new key binding was registered.
*/
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/BlockEntityRendererRegistry.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/BlockEntityRendererRegistry.java
index b37fac0b8a..463a8a7fa0 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/BlockEntityRendererRegistry.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/BlockEntityRendererRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/ColorProviderRegistry.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/ColorProviderRegistry.java
index d77488172f..f7cf64fa37 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/ColorProviderRegistry.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/ColorProviderRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ public interface ColorProviderRegistry {
/**
* Get a color provider for the given object.
- *
+ *
* Please note that the underlying registry may not be fully populated or stable until the game has started,
* as other mods may overwrite the registry.
*
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/EntityRendererRegistry.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/EntityRendererRegistry.java
index d60d525f13..1517571e5b 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/EntityRendererRegistry.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/api/client/render/EntityRendererRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/keybinding/KeyBindingRegistryImpl.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/keybinding/KeyBindingRegistryImpl.java
index 65db6ed4f3..3f66538dc5 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/keybinding/KeyBindingRegistryImpl.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/keybinding/KeyBindingRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/render/ColorProviderRegistryImpl.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/render/ColorProviderRegistryImpl.java
index 29c62cc395..82fff487ed 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/render/ColorProviderRegistryImpl.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/impl/client/render/ColorProviderRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinGameOptions.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinGameOptions.java
index 91e9222d74..5638d603eb 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinGameOptions.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinGameOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinKeyBinding.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinKeyBinding.java
index 47dc54a3e6..eacd373541 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinKeyBinding.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/keybinding/MixinKeyBinding.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockColorMap.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockColorMap.java
index b5b8d8b2af..17b1003bb5 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockColorMap.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockColorMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockEntityRenderManager.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockEntityRenderManager.java
index ebf96867ea..c1090112dd 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockEntityRenderManager.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinBlockEntityRenderManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinEntityRenderManager.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinEntityRenderManager.java
index b0dfa912e9..2d6735e0b3 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinEntityRenderManager.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinEntityRenderManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ public class MixinEntityRenderManager {
private Map, EntityRenderer extends Entity>> renderers;
@Inject(method = "(Lnet/minecraft/client/texture/TextureManager;Lnet/minecraft/client/render/item/ItemRenderer;Lnet/minecraft/resource/ReloadableResourceManager;)V", at = @At("RETURN"), require = 0)
- public void init(TextureManager textureManager,ItemRenderer itemRenderer, ReloadableResourceManager manager, CallbackInfo info) {
+ public void init(TextureManager textureManager, ItemRenderer itemRenderer, ReloadableResourceManager manager, CallbackInfo info) {
EntityRendererRegistry.INSTANCE.initialize((EntityRenderDispatcher) (Object) this, textureManager, manager, itemRenderer, renderers);
}
}
diff --git a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinItemColorMap.java b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinItemColorMap.java
index 9e58fd33fa..fb838d2a6a 100644
--- a/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinItemColorMap.java
+++ b/fabric-client-registries/src/main/java/net/fabricmc/fabric/mixin/client/render/MixinItemColorMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-commands/src/main/java/net/fabricmc/fabric/api/registry/CommandRegistry.java b/fabric-commands/src/main/java/net/fabricmc/fabric/api/registry/CommandRegistry.java
index da0c1177c0..31931f3575 100644
--- a/fabric-commands/src/main/java/net/fabricmc/fabric/api/registry/CommandRegistry.java
+++ b/fabric-commands/src/main/java/net/fabricmc/fabric/api/registry/CommandRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,9 +20,6 @@
import net.fabricmc.fabric.impl.registry.CommandRegistryImpl;
import net.minecraft.server.command.ServerCommandSource;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
import java.util.function.Consumer;
/**
@@ -33,10 +30,11 @@ public class CommandRegistry {
/**
* Register a command provider.
+ *
* @param dedicated If true, the command is only registered on the dedicated server.
- * @param consumer The command provider, consuming {@link CommandDispatcher}.
+ * @param consumer The command provider, consuming {@link CommandDispatcher}.
*/
- public void register(boolean dedicated, Consumer> consumer) {
+ public void register(boolean dedicated, Consumer> consumer) {
CommandRegistryImpl.INSTANCE.register(dedicated, consumer);
}
}
diff --git a/fabric-commands/src/main/java/net/fabricmc/fabric/impl/registry/CommandRegistryImpl.java b/fabric-commands/src/main/java/net/fabricmc/fabric/impl/registry/CommandRegistryImpl.java
index c70c410206..708a930b5a 100644
--- a/fabric-commands/src/main/java/net/fabricmc/fabric/impl/registry/CommandRegistryImpl.java
+++ b/fabric-commands/src/main/java/net/fabricmc/fabric/impl/registry/CommandRegistryImpl.java
@@ -1,7 +1,22 @@
+/*
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.fabricmc.fabric.impl.registry;
import com.mojang.brigadier.CommandDispatcher;
-import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.minecraft.server.command.ServerCommandSource;
import java.util.ArrayList;
@@ -10,25 +25,25 @@
import java.util.function.Consumer;
public class CommandRegistryImpl {
- public static final CommandRegistryImpl INSTANCE = new CommandRegistryImpl();
-
- private final List>> serverCommands;
- private final List>> dedicatedServerCommands;
-
- public CommandRegistryImpl() {
- this.serverCommands = new ArrayList<>();
- this.dedicatedServerCommands = new ArrayList<>();
- }
-
- public List>> entries(boolean dedicated) {
- return Collections.unmodifiableList(dedicated ? dedicatedServerCommands : serverCommands);
- }
-
- public void register(boolean dedicated, Consumer> consumer) {
- if (dedicated) {
- dedicatedServerCommands.add(consumer);
- } else {
- serverCommands.add(consumer);
- }
- }
+ public static final CommandRegistryImpl INSTANCE = new CommandRegistryImpl();
+
+ private final List>> serverCommands;
+ private final List>> dedicatedServerCommands;
+
+ public CommandRegistryImpl() {
+ this.serverCommands = new ArrayList<>();
+ this.dedicatedServerCommands = new ArrayList<>();
+ }
+
+ public List>> entries(boolean dedicated) {
+ return Collections.unmodifiableList(dedicated ? dedicatedServerCommands : serverCommands);
+ }
+
+ public void register(boolean dedicated, Consumer> consumer) {
+ if (dedicated) {
+ dedicatedServerCommands.add(consumer);
+ } else {
+ serverCommands.add(consumer);
+ }
+ }
}
diff --git a/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinMinecraftDedicatedServer.java b/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinMinecraftDedicatedServer.java
index abc8ecc75f..62c706624d 100644
--- a/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinMinecraftDedicatedServer.java
+++ b/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinMinecraftDedicatedServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,14 +19,11 @@
import com.mojang.authlib.GameProfileRepository;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
-import com.mojang.brigadier.CommandDispatcher;
import com.mojang.datafixers.DataFixer;
-import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.fabricmc.fabric.impl.registry.CommandRegistryImpl;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.WorldGenerationProgressListenerFactory;
import net.minecraft.server.command.CommandManager;
-import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.dedicated.MinecraftDedicatedServer;
import net.minecraft.util.UserCache;
import org.spongepowered.asm.mixin.Mixin;
@@ -36,7 +33,6 @@
import java.io.File;
import java.net.Proxy;
-import java.util.function.Consumer;
@Mixin(MinecraftDedicatedServer.class)
public abstract class MixinMinecraftDedicatedServer extends MinecraftServer {
@@ -46,7 +42,7 @@ public MixinMinecraftDedicatedServer(File file_1, Proxy proxy_1, DataFixer dataF
}
@Inject(method = "setupServer", at = @At("HEAD"))
- private void setupServer(CallbackInfoReturnable info){
+ private void setupServer(CallbackInfoReturnable info) {
CommandRegistryImpl.INSTANCE.entries(false).forEach((e) -> e.accept(getCommandManager().getDispatcher()));
CommandRegistryImpl.INSTANCE.entries(true).forEach((e) -> e.accept(getCommandManager().getDispatcher()));
}
diff --git a/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinServerCommandManager.java b/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinServerCommandManager.java
index da6c65c1a3..f2d9a1c314 100644
--- a/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinServerCommandManager.java
+++ b/fabric-commands/src/main/java/net/fabricmc/fabric/mixin/registrycommands/MixinServerCommandManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package net.fabricmc.fabric.mixin.registrycommands;
import com.mojang.brigadier.CommandDispatcher;
-import net.fabricmc.fabric.api.registry.CommandRegistry;
import net.fabricmc.fabric.impl.registry.CommandRegistryImpl;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
@@ -38,7 +37,7 @@ public class MixinServerCommandManager {
@Inject(method = "(Z)V", at = @At("RETURN"))
public void addMethods(boolean dedicated, CallbackInfo info) {
// TODO: Run before findAmbiguities
- if(!dedicated){
+ if (!dedicated) {
CommandRegistryImpl.INSTANCE.entries(false).forEach((e) -> e.accept(dispatcher));
}
}
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ContainerScreenFactory.java b/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ContainerScreenFactory.java
index a8983f7b70..1c89d810f7 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ContainerScreenFactory.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ContainerScreenFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ScreenProviderRegistry.java b/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ScreenProviderRegistry.java
index f6c6af1adb..624f92d2c5 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ScreenProviderRegistry.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/api/client/screen/ScreenProviderRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,21 +28,19 @@ public interface ScreenProviderRegistry {
ScreenProviderRegistry INSTANCE = ScreenProviderRegistryImpl.INSTANCE;
/**
- *
* Register a "Container -> ContainerScreen" factory. This is used only on the client side.
*
- * @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
+ * @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
* @param containerScreenFactory the supplier that should be used to create the new gui
*/
void registerFactory(Identifier identifier, ContainerScreenFactory containerScreenFactory);
/**
- *
* Register a "packet -> ContainerScreen" factory. This is used only on the client side, and allows you
* to override the default behaviour of re-using the existing "packet -> Container" logic.
*
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ContainerProviderRegistry}
- * @param factory the gui factory, this should return a new {@link ContainerScreen}
+ * @param factory the gui factory, this should return a new {@link ContainerScreen}
*/
void registerFactory(Identifier identifier, ContainerFactory factory);
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerFactory.java b/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerFactory.java
index ccc625ae84..61562d3a00 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerFactory.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,13 +24,12 @@
public interface ContainerFactory {
/**
- *
* Creates the new object.
*
- * @param syncId The container synchronization ID.
+ * @param syncId The container synchronization ID.
* @param identifier the Identifier is the name that was used when registering the factory
- * @param player the player that is opening the gui/container
- * @param buf the buffer contains the same data that was provided with {@Link ContainerProviderRegistry.openContainer}
+ * @param player the player that is opening the gui/container
+ * @param buf the buffer contains the same data that was provided with {@Link ContainerProviderRegistry.openContainer}
* @return the new gui or container
*/
T create(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf);
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerProviderRegistry.java b/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerProviderRegistry.java
index 4acabaf35e..ae6d05b8b7 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerProviderRegistry.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/api/container/ContainerProviderRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,31 +31,28 @@ public interface ContainerProviderRegistry {
ContainerProviderRegistry INSTANCE = ContainerProviderImpl.INSTANCE;
/**
- *
* Register a "packet buffer -> container" factory. This is used both on the client and server side.
*
* @param identifier a shared identifier, this identifier should also be used to register a container using {@link ScreenProviderRegistry}
- * @param factory the ContainerFactory that should return a new {@link Container}
+ * @param factory the ContainerFactory that should return a new {@link Container}
*/
void registerFactory(Identifier identifier, ContainerFactory factory);
/**
- *
* Open a modded container.
*
* @param identifier the identifier that was used when registering the container
- * @param player the player that should open the container
- * @param writer a PacketByteBuf where data can be written to, this data is then accessible by the container factory when creating the container or the gui
+ * @param player the player that should open the container
+ * @param writer a PacketByteBuf where data can be written to, this data is then accessible by the container factory when creating the container or the gui
*/
void openContainer(Identifier identifier, ServerPlayerEntity player, Consumer writer);
/**
- *
* Open a modded container. This should be called on the server side - it has no effect on the client side.
*
* @param identifier the identifier that was used when registering the container
- * @param player the player that should open the container
- * @param writer a PacketByteBuf where data can be written to, this data is then accessible by the container factory when creating the container or the gui
+ * @param player the player that should open the container
+ * @param writer a PacketByteBuf where data can be written to, this data is then accessible by the container factory when creating the container or the gui
*/
void openContainer(Identifier identifier, PlayerEntity player, Consumer writer);
}
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/impl/client/gui/ScreenProviderRegistryImpl.java b/fabric-containers/src/main/java/net/fabricmc/fabric/impl/client/gui/ScreenProviderRegistryImpl.java
index 672b5d957d..2f83ba7ac5 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/impl/client/gui/ScreenProviderRegistryImpl.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/impl/client/gui/ScreenProviderRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public void registerFactory(Identifier identifier, ContainerFactory void registerFactory(Identifier identifier, ContainerScreenFactory containerScreenFactory) {
registerFactory(identifier, (syncId, identifier1, player, buf) -> {
C container = ContainerProviderImpl.INSTANCE.createContainer(syncId, identifier1, player, buf);
- if(container == null){
+ if (container == null) {
LOGGER.error("Could not open container for {} - a null object was created!", identifier1.toString());
return null;
}
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/ContainerProviderImpl.java b/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/ContainerProviderImpl.java
index cba50aaed4..a6dd62001c 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/ContainerProviderImpl.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/ContainerProviderImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,14 +78,14 @@ public void openContainer(Identifier identifier, ServerPlayerEntity player, Cons
clonedBuf.readUnsignedByte();
Container container = createContainer(syncId, identifier, player, clonedBuf);
- if(container == null){
+ if (container == null) {
return;
}
player.container = container;
player.container.addListener(player);
}
- public C createContainer(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf){
+ public C createContainer(int syncId, Identifier identifier, PlayerEntity player, PacketByteBuf buf) {
ContainerFactory factory = FACTORIES.get(identifier);
if (factory == null) {
LOGGER.error("No container factory found for {}!", identifier.toString());
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/SyncIdProvider.java b/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/SyncIdProvider.java
index 1d66fbcadd..d8d38f31cc 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/SyncIdProvider.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/impl/container/SyncIdProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-containers/src/main/java/net/fabricmc/fabric/mixin/container/MixinServerPlayerEntity.java b/fabric-containers/src/main/java/net/fabricmc/fabric/mixin/container/MixinServerPlayerEntity.java
index c6219a2fac..600e9710c8 100644
--- a/fabric-containers/src/main/java/net/fabricmc/fabric/mixin/container/MixinServerPlayerEntity.java
+++ b/fabric-containers/src/main/java/net/fabricmc/fabric/mixin/container/MixinServerPlayerEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,9 +23,11 @@
@Mixin(ServerPlayerEntity.class)
public abstract class MixinServerPlayerEntity implements SyncIdProvider {
- @Shadow private int containerSyncId;
+ @Shadow
+ private int containerSyncId;
- @Shadow protected abstract void incrementContainerSyncId();
+ @Shadow
+ protected abstract void incrementContainerSyncId();
@Override
public int fabric_incrementSyncId() {
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/CompostingChanceRegistry.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/CompostingChanceRegistry.java
index 58bc8b29a1..77bf3015bf 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/CompostingChanceRegistry.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/CompostingChanceRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FlammableBlockRegistry.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FlammableBlockRegistry.java
index 065fd8d9f1..2db07d132a 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FlammableBlockRegistry.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FlammableBlockRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FuelRegistry.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FuelRegistry.java
index 8a00017b33..23861caf52 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FuelRegistry.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/FuelRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java
index 315c99e914..251e2bab65 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/registry/LootEntryTypeRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Block2ObjectMap.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Block2ObjectMap.java
index 0ae014c1e9..bb46d53714 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Block2ObjectMap.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Block2ObjectMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,16 +17,20 @@
package net.fabricmc.fabric.api.util;
import net.minecraft.block.Block;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemProvider;
import net.minecraft.tag.Tag;
public interface Block2ObjectMap {
V get(Block block);
+
void add(Block block, V value);
+
void add(Tag tag, V value);
+
void remove(Block block);
+
void remove(Tag tag);
+
void clear(Block block);
+
void clear(Tag tag);
}
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Item2ObjectMap.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Item2ObjectMap.java
index b402d94b3a..a035a3c0dd 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Item2ObjectMap.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/api/util/Item2ObjectMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,10 +22,16 @@
public interface Item2ObjectMap {
V get(ItemProvider item);
+
void add(ItemProvider item, V value);
+
void add(Tag tag, V value);
+
void remove(ItemProvider item);
+
void remove(Tag tag);
+
void clear(ItemProvider item);
+
void clear(Tag tag);
}
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/CompostingChanceRegistryImpl.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/CompostingChanceRegistryImpl.java
index 8e4ef25bf6..0ce346581d 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/CompostingChanceRegistryImpl.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/CompostingChanceRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,9 +22,6 @@
import net.minecraft.item.ItemProvider;
import net.minecraft.tag.Tag;
-import java.util.ArrayList;
-import java.util.List;
-
public class CompostingChanceRegistryImpl implements CompostingChanceRegistry {
@Override
public Float get(ItemProvider item) {
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FireBlockHooks.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FireBlockHooks.java
index 8566a044cd..ed781240f5 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FireBlockHooks.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FireBlockHooks.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package net.fabricmc.fabric.impl.registry;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
-import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
public interface FireBlockHooks {
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FlammableBlockRegistryImpl.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FlammableBlockRegistryImpl.java
index e3e4f1d3bd..06bcaeda2b 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FlammableBlockRegistryImpl.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FlammableBlockRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,7 @@
package net.fabricmc.fabric.impl.registry;
-import it.unimi.dsi.fastutil.objects.Object2IntMap;
-import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
-import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.ResourceReloadListenerKeys;
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
@@ -28,13 +25,11 @@
import net.minecraft.resource.ResourceType;
import net.minecraft.tag.Tag;
import net.minecraft.util.Identifier;
-import net.minecraft.util.profiler.Profiler;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import java.util.concurrent.CompletableFuture;
public class FlammableBlockRegistryImpl implements FlammableBlockRegistry, SimpleSynchronousResourceReloadListener {
private static final FlammableBlockRegistry.Entry REMOVED = new FlammableBlockRegistry.Entry(0, 0);
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FuelRegistryImpl.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FuelRegistryImpl.java
index c588a711d6..7908230f53 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FuelRegistryImpl.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/FuelRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/LootEntryTypeRegistryImpl.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/LootEntryTypeRegistryImpl.java
index fa3c0f0ce4..c07cad5c21 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/LootEntryTypeRegistryImpl.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/impl/registry/LootEntryTypeRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,8 +20,6 @@
import net.minecraft.world.loot.entry.LootEntries;
import net.minecraft.world.loot.entry.LootEntry;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.util.function.Consumer;
@@ -50,7 +48,8 @@ public final class LootEntryTypeRegistryImpl implements LootEntryTypeRegistry {
}
}
- private LootEntryTypeRegistryImpl() {}
+ private LootEntryTypeRegistryImpl() {
+ }
@Override
public void register(LootEntry.Serializer> serializer) {
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinAbstractFurnaceBlockEntity.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinAbstractFurnaceBlockEntity.java
index 7cb1587c44..e1bec9ae03 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinAbstractFurnaceBlockEntity.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinAbstractFurnaceBlockEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinFireBlock.java b/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinFireBlock.java
index 43ee0279dc..a78d9036d1 100644
--- a/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinFireBlock.java
+++ b/fabric-content-registries/src/main/java/net/fabricmc/fabric/mixin/registryextras/MixinFireBlock.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-crash-report-info/src/main/java/net/fabricmc/fabric/mixin/crash/MixinCrashReport.java b/fabric-crash-report-info/src/main/java/net/fabricmc/fabric/mixin/crash/MixinCrashReport.java
index 6f23d54e8e..98b1a2bde3 100644
--- a/fabric-crash-report-info/src/main/java/net/fabricmc/fabric/mixin/crash/MixinCrashReport.java
+++ b/fabric-crash-report-info/src/main/java/net/fabricmc/fabric/mixin/crash/MixinCrashReport.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import java.util.*;
-
@Mixin(CrashReport.class)
public abstract class MixinCrashReport {
@Shadow
@@ -53,4 +51,4 @@ private void fillSystemDetails(CallbackInfo info) {
return modString.toString();
});
}
-}
\ No newline at end of file
+}
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockAttackInteractionAware.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockAttackInteractionAware.java
index 9223d1ce0b..87cba2f7de 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockAttackInteractionAware.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockAttackInteractionAware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java
index 1c83a3e673..3689a1cc04 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/entity/EntityPickInteractionAware.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/entity/EntityPickInteractionAware.java
index 31343cd598..7bf7e0c1b1 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/entity/EntityPickInteractionAware.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/entity/EntityPickInteractionAware.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockApplyCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockApplyCallback.java
index 1c1c28db07..cdfbdffb7e 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockApplyCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockApplyCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockCallback.java
index 2be7a384c6..6f26c2d155 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockGatherCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockGatherCallback.java
index e1747c8a76..4ffc6d080a 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockGatherCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/client/player/ClientPickBlockGatherCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackBlockCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackBlockCallback.java
index 97aadfa373..1c5acefb78 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackBlockCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackBlockCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,12 +28,12 @@
/**
* Callback for left-clicking ("attacking") a block.
* Is hooked in before the spectator check, so make sure to check for the player's game mode as well!
- *
+ *
* Upon return:
* - SUCCESS cancels further processing and, on the client, sends a packet to the server.
* - PASS falls back to further processing.
* - FAIL cancels further processing and does not send a packet to the server.
- *
+ *
* ATTACK_BLOCK does not let you control the packet sending process yet.
*/
public interface AttackBlockCallback {
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackEntityCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackEntityCallback.java
index 17129cb6f6..76e366aacf 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackEntityCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/AttackEntityCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
/**
* Callback for left-clicking ("attacking") an entity.
* Is hooked in before the spectator check, so make sure to check for the player's game mode as well!
- *
+ *
* Upon return:
* - SUCCESS cancels further processing and, on the client, sends a packet to the server.
* - PASS falls back to further processing.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseBlockCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseBlockCallback.java
index a654807a22..5f4fd742da 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseBlockCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseBlockCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
/**
* Callback for right-clicking ("using") a block.
* Is hooked in before the spectator check, so make sure to check for the player's game mode as well!
- *
+ *
* Upon return:
* - SUCCESS cancels further processing and, on the client, sends a packet to the server.
* - PASS falls back to further processing.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseEntityCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseEntityCallback.java
index 4cde9dc5c8..94786ef1a0 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseEntityCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseEntityCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
/**
* Callback for right-clicking ("using") an entity.
* Is hooked in before the spectator check, so make sure to check for the player's game mode as well!
- *
+ *
* Upon return:
* - SUCCESS cancels further processing and, on the client, sends a packet to the server.
* - PASS falls back to further processing.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseItemCallback.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseItemCallback.java
index 10c4cfc526..38e27d5b5e 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseItemCallback.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/api/event/player/UseItemCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
/**
* Callback for right-clicking ("using") an item.
* Is hooked in before the spectator check, so make sure to check for the player's game mode as well!
- *
+ *
* Upon return:
* - SUCCESS cancels further processing and, on the client, sends a packet to the server.
* - PASS falls back to further processing.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouter.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouter.java
index 9d7669a1ca..afc9fcfef6 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouter.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouter.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.fabricmc.fabric.impl.event;
import net.fabricmc.api.ModInitializer;
@@ -7,21 +23,21 @@
import net.minecraft.util.ActionResult;
public class InteractionEventsRouter implements ModInitializer {
- @Override
- public void onInitialize() {
- AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> {
- BlockState state = world.getBlockState(pos);
- if (state instanceof BlockAttackInteractionAware) {
- if (((BlockAttackInteractionAware) state).onAttackInteraction(state, world, pos, player, hand, direction)) {
- return ActionResult.FAIL;
- }
- } else if (state.getBlock() instanceof BlockAttackInteractionAware) {
- if (((BlockAttackInteractionAware) state.getBlock()).onAttackInteraction(state, world, pos, player, hand, direction)) {
- return ActionResult.FAIL;
- }
- }
+ @Override
+ public void onInitialize() {
+ AttackBlockCallback.EVENT.register((player, world, hand, pos, direction) -> {
+ BlockState state = world.getBlockState(pos);
+ if (state instanceof BlockAttackInteractionAware) {
+ if (((BlockAttackInteractionAware) state).onAttackInteraction(state, world, pos, player, hand, direction)) {
+ return ActionResult.FAIL;
+ }
+ } else if (state.getBlock() instanceof BlockAttackInteractionAware) {
+ if (((BlockAttackInteractionAware) state.getBlock()).onAttackInteraction(state, world, pos, player, hand, direction)) {
+ return ActionResult.FAIL;
+ }
+ }
- return ActionResult.PASS;
- });
- }
+ return ActionResult.PASS;
+ });
+ }
}
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouterClient.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouterClient.java
index 20214c2edc..c85a9e0ef7 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouterClient.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/impl/event/InteractionEventsRouterClient.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.fabricmc.fabric.impl.event;
import net.fabricmc.api.ClientModInitializer;
@@ -13,26 +29,26 @@
import net.minecraft.world.BlockView;
public class InteractionEventsRouterClient implements ClientModInitializer {
- @Override
- public void onInitializeClient() {
- ClientPickBlockGatherCallback.EVENT.register(((player, result) -> {
- if (result instanceof BlockHitResult) {
- BlockView view = player.getEntityWorld();
- BlockPos pos = ((BlockHitResult) result).getBlockPos();
- BlockState state = view.getBlockState(pos);
+ @Override
+ public void onInitializeClient() {
+ ClientPickBlockGatherCallback.EVENT.register(((player, result) -> {
+ if (result instanceof BlockHitResult) {
+ BlockView view = player.getEntityWorld();
+ BlockPos pos = ((BlockHitResult) result).getBlockPos();
+ BlockState state = view.getBlockState(pos);
- if (state.getBlock() instanceof BlockPickInteractionAware) {
- return (((BlockPickInteractionAware) state.getBlock()).getPickedStack(state, view, pos, player, result));
- }
- } else if (result instanceof EntityHitResult) {
- Entity entity = ((EntityHitResult) result).getEntity();
+ if (state.getBlock() instanceof BlockPickInteractionAware) {
+ return (((BlockPickInteractionAware) state.getBlock()).getPickedStack(state, view, pos, player, result));
+ }
+ } else if (result instanceof EntityHitResult) {
+ Entity entity = ((EntityHitResult) result).getEntity();
- if (entity instanceof EntityPickInteractionAware) {
- return ((EntityPickInteractionAware) entity).getPickedStack(player, result);
- }
- }
+ if (entity instanceof EntityPickInteractionAware) {
+ return ((EntityPickInteractionAware) entity).getPickedStack(player, result);
+ }
+ }
- return ItemStack.EMPTY;
- }));
- }
+ return ItemStack.EMPTY;
+ }));
+ }
}
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinClientPlayerInteractionManager.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinClientPlayerInteractionManager.java
index 04ac335b65..911f90dec6 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinClientPlayerInteractionManager.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinClientPlayerInteractionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinMinecraftClient.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinMinecraftClient.java
index 0d7bf3beb3..60125d9a5e 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinMinecraftClient.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinMinecraftClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
-import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(MinecraftClient.class)
@@ -96,6 +95,7 @@ private void fabric_doItemPickWrapper(CallbackInfo info) {
@Shadow
public abstract void doItemPick();
+
@Shadow
public abstract ItemStack addBlockEntityNbt(ItemStack itemStack_1, BlockEntity blockEntity_1);
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayNetworkHandler.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayNetworkHandler.java
index d29f79a5f6..322ef27b44 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayNetworkHandler.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayNetworkHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerEntity.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerEntity.java
index e171159918..20a2c862af 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerEntity.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerInteractionManager.java b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerInteractionManager.java
index 95e7fac063..b73f5721d8 100644
--- a/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerInteractionManager.java
+++ b/fabric-events-interaction/src/main/java/net/fabricmc/fabric/mixin/eventsinteraction/MixinServerPlayerInteractionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/client/ClientTickCallback.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/client/ClientTickCallback.java
index d31e904dcc..e2aacfa456 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/client/ClientTickCallback.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/client/ClientTickCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStartCallback.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStartCallback.java
index 7ffe4163b6..836677d303 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStartCallback.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStartCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStopCallback.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStopCallback.java
index 758e0f13da..fea2c82b41 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStopCallback.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerStopCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerTickCallback.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerTickCallback.java
index 7582548eed..de712b879e 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerTickCallback.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/server/ServerTickCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/world/WorldTickCallback.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/world/WorldTickCallback.java
index 9816a7ad55..7e2b21a7af 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/world/WorldTickCallback.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/api/event/world/WorldTickCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftClient.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftClient.java
index 0a5239932a..e89201a40a 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftClient.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,12 +17,8 @@
package net.fabricmc.fabric.mixin.eventslifecycle;
import net.fabricmc.fabric.api.event.client.ClientTickCallback;
-import net.fabricmc.fabric.api.event.world.WorldTickCallback;
import net.minecraft.client.MinecraftClient;
-import net.minecraft.util.profiler.DisableableProfiler;
-import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftServer.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftServer.java
index 86dafe3bbc..84897d0215 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftServer.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinMinecraftServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,9 +20,7 @@
import net.fabricmc.fabric.api.event.server.ServerStopCallback;
import net.fabricmc.fabric.api.event.server.ServerTickCallback;
import net.minecraft.server.MinecraftServer;
-import net.minecraft.util.profiler.DisableableProfiler;
import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
diff --git a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinWorld.java b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinWorld.java
index 70689d1785..aa21af5cd6 100644
--- a/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinWorld.java
+++ b/fabric-events-lifecycle/src/main/java/net/fabricmc/fabric/mixin/eventslifecycle/MixinWorld.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,16 +17,12 @@
package net.fabricmc.fabric.mixin.eventslifecycle;
import net.fabricmc.fabric.api.event.world.WorldTickCallback;
-import net.minecraft.util.profiler.Profiler;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import java.util.function.BooleanSupplier;
-
@Mixin(World.class)
public class MixinWorld {
// TODO split into ClientWorld/ServerWorld ticks? mmm need more mappings
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java
index 20a8e6c174..95d17c28c2 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/api/client/itemgroup/FabricItemGroupBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@ private FabricItemGroupBuilder(Identifier identifier) {
}
/**
- *
* Create a new Item Group Builder
*
* @param identifier the id will become the name of the ItemGroup and will be used for the translation key
@@ -48,7 +47,6 @@ public static FabricItemGroupBuilder create(Identifier identifier) {
}
/**
- *
* This is used to add an icon to to the item group
*
* @param stackSupplier the supplier should return the item stack that you wish to show on the tab
@@ -60,7 +58,6 @@ public FabricItemGroupBuilder icon(Supplier stackSupplier) {
}
/**
- *
* This allows for a custom list of items to be displayed in a tab, this enabled tabs to be created with a custom set of items
*
* @param appender Add ItemStack's to this list to show in the ItemGroup
@@ -73,7 +70,6 @@ public FabricItemGroupBuilder stacksForDisplay(Consumer> appende
}
/**
- *
* This allows for a custom list of items to be displayed in a tab, this enabled tabs to be created with a custom set of items
*
* @param stacksForDisplay Add ItemStack's to this list to show in the ItemGroup
@@ -85,20 +81,18 @@ public FabricItemGroupBuilder appendItems(Consumer> stacksForDis
}
/**
- *
* This is a single method that makes creating an ItemGroup with an icon one call
*
- * @param identifier the id will become the name of the ItemGroup and will be used for the translation key
+ * @param identifier the id will become the name of the ItemGroup and will be used for the translation key
* @param stackSupplier the supplier should return the item stack that you wish to show on the tab
* @return An instance of the built ItemGroup
*/
- public static ItemGroup build(Identifier identifier, Supplier stackSupplier){
+ public static ItemGroup build(Identifier identifier, Supplier stackSupplier) {
return new FabricItemGroupBuilder(identifier).icon(stackSupplier).build();
}
/**
- *
- * Create an instance of the ItemGroup
+ * Create an instance of the ItemGroup
*
* @return An instance of the built ItemGroup
*/
@@ -112,7 +106,7 @@ public ItemStack createIcon() {
@Override
public void appendItems(DefaultedList stacks) {
- if(stacksForDisplay != null){
+ if (stacksForDisplay != null) {
stacksForDisplay.accept(stacks);
return;
}
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/CreativeGuiExtensions.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/CreativeGuiExtensions.java
index 09921b5679..25123ca6de 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/CreativeGuiExtensions.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/CreativeGuiExtensions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/FabricCreativeGuiComponents.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/FabricCreativeGuiComponents.java
index a1ece3e694..825bc46052 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/FabricCreativeGuiComponents.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/FabricCreativeGuiComponents.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ public void render(int mouseX, int mouseY, float float_1) {
GlStateManager.color4f(1F, 1F, 1F, 1F);
this.blit(this.x, this.y, (type == Type.NEXT ? 12 : 0), (active ? 0 : 12), 12, 12);
- if(mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height){
+ if (mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height) {
gui.renderTooltip(I18n.translate("fabric.gui.creativeTabPage", extensions.fabric_currentPage() + 1, ((ItemGroup.GROUPS.length - 12) / 9) + 2), mouseX, mouseY);
}
}
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/ItemGroupExtensions.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/ItemGroupExtensions.java
index 9ea5aa9ba5..45f2366e23 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/ItemGroupExtensions.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/impl/itemgroup/ItemGroupExtensions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/MixinItemGroup.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/MixinItemGroup.java
index ea9bcf6d40..d507b6d686 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/MixinItemGroup.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/MixinItemGroup.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java
index 6165324670..98bfe36d67 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinCreativePlayerInventoryGui.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinItemGroup.java b/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinItemGroup.java
index 7ca966b789..147164c503 100644
--- a/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinItemGroup.java
+++ b/fabric-item-groups/src/main/java/net/fabricmc/fabric/mixin/itemgroup/client/MixinItemGroup.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
import net.fabricmc.fabric.impl.itemgroup.FabricCreativeGuiComponents;
import net.minecraft.item.ItemGroup;
-import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
diff --git a/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/Event.java b/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/Event.java
index 2f6ea663b6..4a78cb157c 100644
--- a/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/Event.java
+++ b/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/Event.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public abstract class Event {
/**
* Returns the invoker instance.
- *
+ *
* An "invoker" is an object which hides multiple registered
* listeners of type T under one instance of type T, executing
* them and leaving early as necessary.
diff --git a/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java b/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java
index 5042ebe248..9213360a58 100644
--- a/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java
+++ b/fabric-lib/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,9 +50,9 @@ public static void invalidate() {
/**
* Create an "array-backed" Event instance.
*
- * @param type The listener class type.
+ * @param type The listener class type.
* @param invokerFactory The invoker factory, combining multiple listeners into one instance.
- * @param The listener type.
+ * @param The listener type.
* @return The Event instance.
*/
public static Event createArrayBacked(Class type, Function invokerFactory) {
@@ -61,15 +61,15 @@ public static Event createArrayBacked(Class type, Function inv
/**
* Create an "array-backed" Event instance with a custom empty invoker.
- *
+ *
* Having a custom empty invoker (of type (...) -> {}) increases performance
* relative to iterating over an empty array; however, it only really matters
* if the event is executed thousands of times a second.
*
- * @param type The listener class type.
- * @param emptyInvoker The custom empty invoker.
+ * @param type The listener class type.
+ * @param emptyInvoker The custom empty invoker.
* @param invokerFactory The invoker factory, combining multiple listeners into one instance.
- * @param The listener type.
+ * @param The listener type.
* @return The Event instance.
*/
// TODO: Deprecate this once we have working codegen
diff --git a/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/NbtType.java b/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/NbtType.java
index 15d597162c..9311244958 100644
--- a/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/NbtType.java
+++ b/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/NbtType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
*
* @see CompoundTag#containsKey(String, int)
* @see Tag#idToString(int)
- *
+ *
* For the current list of types, check with {@link Tag#TYPES}.
*/
public final class NbtType {
diff --git a/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/TriState.java b/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/TriState.java
index 5ed698368a..fe82544561 100644
--- a/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/TriState.java
+++ b/fabric-lib/src/main/java/net/fabricmc/fabric/api/util/TriState.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java b/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java
index 8f383bf019..71b66325c6 100644
--- a/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java
+++ b/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/ArrayBackedEvent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/EventFactoryImpl.java b/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/EventFactoryImpl.java
index 292f07e70b..abdc53bb49 100644
--- a/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/EventFactoryImpl.java
+++ b/fabric-lib/src/main/java/net/fabricmc/fabric/impl/event/EventFactoryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
-import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
@@ -97,7 +96,7 @@ private static T buildEmptyInvoker(Class handlerClass, Function i
final Object returnValue = defValue;
//noinspection unchecked
- return (T) Proxy.newProxyInstance(EventFactoryImpl.class.getClassLoader(), new Class[] { handlerClass },
+ return (T) Proxy.newProxyInstance(EventFactoryImpl.class.getClassLoader(), new Class[]{handlerClass},
(proxy, method, args) -> returnValue);
}
}
diff --git a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tag/FabricItemTags.java b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tag/FabricItemTags.java
index 69e36f3a59..6c2383b77e 100644
--- a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tag/FabricItemTags.java
+++ b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tag/FabricItemTags.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tools/FabricToolTags.java b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tools/FabricToolTags.java
index 47e9bfcac8..f25a74c1b1 100644
--- a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tools/FabricToolTags.java
+++ b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/api/tools/FabricToolTags.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java
index b98fb29141..696aa92e83 100644
--- a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java
+++ b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/impl/tools/ToolManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
public final class ToolManager {
public interface Entry {
void setBreakByHand(boolean value);
+
void putBreakByTool(Tag tag, int miningLevel);
}
diff --git a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java
index 620ec9b3d9..8a3a88ab90 100644
--- a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java
+++ b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MiningToolItemAccessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java
index ee959aff13..a9ed877036 100644
--- a/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java
+++ b/fabric-mining-levels/src/main/java/net/fabricmc/fabric/mixin/tools/MixinItemStack.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
package net.fabricmc.fabric.mixin.tools;
-import net.fabricmc.fabric.impl.tools.ToolManager;
import net.fabricmc.fabric.api.util.TriState;
+import net.fabricmc.fabric.impl.tools.ToolManager;
import net.minecraft.block.BlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelAppender.java b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelAppender.java
index 224e4aa427..d433abd4fd 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelAppender.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelAppender.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelLoadingRegistry.java b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelLoadingRegistry.java
index 81f2879285..ad15fe02f7 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelLoadingRegistry.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelLoadingRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderContext.java b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderContext.java
index 7e9e79f813..072a334eff 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderContext.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
public interface ModelProviderContext {
/**
* Load a model using a {@link Identifier}, {@link ModelIdentifier}, ...
- *
+ *
* Please note that the game engine keeps track of circular model loading calls on its own.
*
* @param id The model identifier.
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderException.java b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderException.java
index b157386140..1d7899927e 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderException.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelProviderException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelResourceProvider.java b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelResourceProvider.java
index c2c790ce1d..e52e531a03 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelResourceProvider.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelResourceProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,26 +17,25 @@
package net.fabricmc.fabric.api.client.model;
import net.minecraft.client.render.model.UnbakedModel;
-import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.util.Identifier;
/**
* Interface for model resource providers.
- *
+ *
* Model resource providers hook the loading of model *files* from the resource tree;
* that is, in vanilla, it handles going from "minecraft:block/stone" to a
* "assets/minecraft/models/block/stone.json" file.
- *
+ *
* This is where you want to add your own custom model formats.
- *
+ *
* As providers are instantiated with a new provider, it is safe
* (and recommended!) to cache information inside a loader.
- *
+ *
* Keep in mind that only *one* ModelResourceProvider may respond to a given model
* at any time. If you're writing, say, an OBJ loader, this means you could
* easily conflict with another OBJ loader unless you take some precautions,
* for example:
- *
+ *
* a) Only load files with a mod-suffixed name, such as .architect.obj,
* b) Only load files from an explicit list of namespaces, registered elsewhere.
*/
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelVariantProvider.java b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelVariantProvider.java
index eac625d9a5..476ad70652 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelVariantProvider.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/api/client/model/ModelVariantProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,22 +18,21 @@
import net.minecraft.client.render.model.UnbakedModel;
import net.minecraft.client.util.ModelIdentifier;
-import net.minecraft.util.Identifier;
/**
* Interface for model variant providers.
- *
+ *
* Model variant providers hook the resolution of ModelIdentifiers. In vanilla, this is
* the part where a "minecraft:stone#normal" identifier triggers the loading of a
* "minecraft:models/stone" model ({@link ModelResourceProvider} handles the later step).
- *
+ *
* The most common use of this is to cooperate with a {@link ModelAppender}, but it can
* also allow you to add your own block- or item-state formats. To trigger the loading
* of another model, use the passed {@link ModelProviderContext}.
- *
+ *
* As every model loading is instantiated with a new provider, it is safe
* (and recommended!) to cache information.
- *
+ *
* Keep in mind that only *one* ModelVariantProvider may respond to a given model
* at any time.
*/
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoaderHooks.java b/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoaderHooks.java
index 333978e373..c4b7fbe4f9 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoaderHooks.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoaderHooks.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,5 +22,6 @@
public interface ModelLoaderHooks {
void fabric_addModel(ModelIdentifier id);
+
UnbakedModel fabric_loadModel(Identifier id);
}
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoadingRegistryImpl.java b/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoadingRegistryImpl.java
index f0a85a5ef8..67cf708820 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoadingRegistryImpl.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/impl/client/model/ModelLoadingRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
diff --git a/fabric-models/src/main/java/net/fabricmc/fabric/mixin/client/model/MixinModelLoader.java b/fabric-models/src/main/java/net/fabricmc/fabric/mixin/client/model/MixinModelLoader.java
index 78ddd60dbd..be9db76f4e 100644
--- a/fabric-models/src/main/java/net/fabricmc/fabric/mixin/client/model/MixinModelLoader.java
+++ b/fabric-models/src/main/java/net/fabricmc/fabric/mixin/client/model/MixinModelLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
package net.fabricmc.fabric.mixin.client.model;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
import net.fabricmc.fabric.impl.client.model.ModelLoaderHooks;
import net.fabricmc.fabric.impl.client.model.ModelLoadingRegistryImpl;
import net.minecraft.client.render.model.ModelLoader;
diff --git a/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/api/block/entity/BlockEntityClientSerializable.java b/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/api/block/entity/BlockEntityClientSerializable.java
index 2207a03a06..f500f5b2a2 100644
--- a/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/api/block/entity/BlockEntityClientSerializable.java
+++ b/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/api/block/entity/BlockEntityClientSerializable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,5 +24,6 @@
*/
public interface BlockEntityClientSerializable {
void fromClientTag(CompoundTag tag);
+
CompoundTag toClientTag(CompoundTag tag);
}
diff --git a/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinBlockEntity.java b/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinBlockEntity.java
index 39a0a36dc7..756cababd4 100644
--- a/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinBlockEntity.java
+++ b/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinBlockEntity.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinClientPlayNetworkHandler.java b/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinClientPlayNetworkHandler.java
index 3fbda363e3..0fbcd906ea 100644
--- a/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinClientPlayNetworkHandler.java
+++ b/fabric-networking-blockentity/src/main/java/net/fabricmc/fabric/mixin/networkingblockentity/MixinClientPlayNetworkHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/C2SPacketTypeCallback.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/C2SPacketTypeCallback.java
index 8f4adc723a..c730c528fa 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/C2SPacketTypeCallback.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/C2SPacketTypeCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ public interface C2SPacketTypeCallback {
* Accept a collection of types.
*
* @param client The player who is the source of the packet.
- * @param types The provided collection of types.
+ * @param types The provided collection of types.
*/
void accept(PlayerEntity client, Collection types);
}
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/S2CPacketTypeCallback.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/S2CPacketTypeCallback.java
index a2d6169342..44f8911c69 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/S2CPacketTypeCallback.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/event/network/S2CPacketTypeCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ClientSidePacketRegistry.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ClientSidePacketRegistry.java
index 883854a281..902430d589 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ClientSidePacketRegistry.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ClientSidePacketRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,9 +25,9 @@
/**
* The client-side packet registry.
- *
+ *
* It is used for:
- *
+ *
* - registering client-side packet receivers (server -> client packets)
* - sending packets to the server (client -> server packets).
*/
@@ -45,20 +45,20 @@ public interface ClientSidePacketRegistry extends PacketRegistry {
/**
* Send a packet to the server.
-
- * @param packet The packet to be sent.
+ *
+ * @param packet The packet to be sent.
* @param completionListener Completion listener. Can be used to check for
- * the success or failure of sending a given packet, among others.
+ * the success or failure of sending a given packet, among others.
*/
void sendToServer(Packet> packet, GenericFutureListener extends Future super Void>> completionListener);
/**
* Send an identifier/buffer-based packet to the server.
-
- * @param id The packet identifier.
- * @param buf The packet byte buffer.
+ *
+ * @param id The packet identifier.
+ * @param buf The packet byte buffer.
* @param completionListener Completion listener. Can be used to check for
- * the success or failure of sending a given packet, among others.
+ * the success or failure of sending a given packet, among others.
*/
default void sendToServer(Identifier id, PacketByteBuf buf, GenericFutureListener extends Future super Void>> completionListener) {
sendToServer(toPacket(id, buf), completionListener);
@@ -66,7 +66,7 @@ default void sendToServer(Identifier id, PacketByteBuf buf, GenericFutureListene
/**
* Send a packet to the server.
-
+ *
* @param packet The packet to be sent.
*/
default void sendToServer(Packet> packet) {
@@ -75,8 +75,8 @@ default void sendToServer(Packet> packet) {
/**
* Send an identifier/buffer-based packet to the server.
-
- * @param id The packet identifier.
+ *
+ * @param id The packet identifier.
* @param buf The packet byte buffer.
*/
default void sendToServer(Identifier id, PacketByteBuf buf) {
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketConsumer.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketConsumer.java
index adc1a81d32..37c3689d9a 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketConsumer.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketConsumer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
public interface PacketConsumer {
/**
* Receive a CustomPayload-based packet.
- *
+ *
* Please keep in mind that this CAN be called OUTSIDE of the main thread!
* Most game operations are not thread-safe, so you should look into using
* the thread task queue ({@link PacketContext#getTaskQueue()}) to split
@@ -34,7 +34,7 @@ public interface PacketConsumer {
* on the main thread).
*
* @param context The context (receiving player, side, etc.)
- * @param buffer The byte buffer containing the received packet data.
+ * @param buffer The byte buffer containing the received packet data.
*/
void accept(PacketContext context, PacketByteBuf buffer);
}
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketContext.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketContext.java
index 98dffecf3c..d70ecb8f42 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketContext.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,13 +30,13 @@ public interface PacketContext {
* Get the environment associated with the packet.
*
* @return EnvType.CLIENT if processing packet on the client side,
- * EnvType.SERVER otherwise.
+ * EnvType.SERVER otherwise.
*/
EnvType getPacketEnvironment();
/**
* Get the player associated with the packet.
- *
+ *
* On the client side, this always returns the client-side player instance.
* On the server side, it returns the player belonging to the client this
* packet was sent by.
@@ -47,15 +47,15 @@ public interface PacketContext {
/**
* Get the task queue for a given side.
- *
+ *
* As Minecraft networking I/O is asynchronous, but a lot of its logic is
* not thread-safe, it is recommended to do the following:
- *
+ *
* - read and parse the PacketByteBuf,
* - run the packet response logic through the main thread task queue via
- * ThreadTaskQueue.execute(). The method will check if it's not already
- * on the main thread in order to avoid unnecessary delays, so don't
- * worry about that!
+ * ThreadTaskQueue.execute(). The method will check if it's not already
+ * on the main thread in order to avoid unnecessary delays, so don't
+ * worry about that!
*
* @return The thread task queue.
*/
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketRegistry.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketRegistry.java
index 854c51e4be..3355294617 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketRegistry.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/PacketRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ public interface PacketRegistry {
* Turn a (identifier, byte buffer) pair into a "custom payload" packet
* suitable for sending in the PacketRegistry's sending direction.
*
- * @param id The identifier.
+ * @param id The identifier.
* @param buf The byte buffer.
* @return
*/
@@ -34,7 +34,7 @@ public interface PacketRegistry {
/**
* Register a packet.
*
- * @param id The packet Identifier.
+ * @param id The packet Identifier.
* @param consumer The method used for handling the packet.
*/
void register(Identifier id, PacketConsumer consumer);
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ServerSidePacketRegistry.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ServerSidePacketRegistry.java
index 6e1fbdd625..ce347477be 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ServerSidePacketRegistry.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/network/ServerSidePacketRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,12 +27,12 @@
/**
* The server-side packet registry.
- *
+ *
* For iterating over clients in a server, see {@link PlayerStream}.
*/
public interface ServerSidePacketRegistry extends PacketRegistry {
@@ -50,21 +50,21 @@ public interface ServerSidePacketRegistry extends PacketRegistry {
/**
* Send a packet to a given client.
*
- * @param player The given client.
- * @param packet The packet to be sent.
+ * @param player The given client.
+ * @param packet The packet to be sent.
* @param completionListener Completion listener. Can be used to check for
- * the success or failure of sending a given packet, among others.
+ * the success or failure of sending a given packet, among others.
*/
void sendToPlayer(PlayerEntity player, Packet> packet, GenericFutureListener extends Future super Void>> completionListener);
/**
* Send an identifier/buffer-based packet to a given client.
*
- * @param player The given client.
- * @param id The packet identifier.
- * @param buf The packet byte buffer.
+ * @param player The given client.
+ * @param id The packet identifier.
+ * @param buf The packet byte buffer.
* @param completionListener Completion listener. Can be used to check for
- * the success or failure of sending a given packet, among others.
+ * the success or failure of sending a given packet, among others.
*/
default void sendToPlayer(PlayerEntity player, Identifier id, PacketByteBuf buf, GenericFutureListener extends Future super Void>> completionListener) {
sendToPlayer(player, toPacket(id, buf), completionListener);
@@ -84,8 +84,8 @@ default void sendToPlayer(PlayerEntity player, Packet> packet) {
* Send an identifier/buffer-based packet to a given client.
*
* @param player The given client.
- * @param id The packet identifier.
- * @param buf The packet byte buffer.
+ * @param id The packet identifier.
+ * @param buf The packet byte buffer.
*/
default void sendToPlayer(PlayerEntity player, Identifier id, PacketByteBuf buf) {
sendToPlayer(player, id, buf, null);
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java b/fabric-networking/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java
index 0071666139..acb8b7d359 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/api/server/PlayerStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
/**
* Helper streams for looking up players on a server.
- *
+ *
* In general, most of these methods will only function with a {@link ServerWorld} instance.
*/
public final class PlayerStream {
@@ -108,4 +108,4 @@ public static Stream around(World world, BlockPos pos, double radi
double radiusSq = radius * radius;
return world(world).filter((p) -> p.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) <= radiusSq);
}
-}
\ No newline at end of file
+}
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ClientSidePacketRegistryImpl.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ClientSidePacketRegistryImpl.java
index 1118b13008..f7e3275edf 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ClientSidePacketRegistryImpl.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ClientSidePacketRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/CustomPayloadC2SPacketAccessor.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/CustomPayloadC2SPacketAccessor.java
index 56782353af..bcce9eebfd 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/CustomPayloadC2SPacketAccessor.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/CustomPayloadC2SPacketAccessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,5 +25,6 @@
*/
public interface CustomPayloadC2SPacketAccessor {
Identifier getChannel();
+
PacketByteBuf getData();
}
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketRegistryImpl.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketRegistryImpl.java
index 4264107de0..ee9b34a5ec 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketRegistryImpl.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
import org.apache.logging.log4j.Logger;
import java.nio.charset.StandardCharsets;
-import java.util.*;
public abstract class PacketRegistryImpl implements PacketRegistry {
protected static final Logger LOGGER = LogManager.getLogger();
@@ -63,9 +62,13 @@ public void unregister(Identifier id) {
}
protected abstract void onRegister(Identifier id);
+
protected abstract void onUnregister(Identifier id);
+
protected abstract Collection getIdCollectionFor(PacketContext context);
+
protected abstract void onReceivedRegisterPacket(PacketContext context, Collection ids);
+
protected abstract void onReceivedUnregisterPacket(PacketContext context, Collection ids);
protected Packet> createRegisterTypePacket(Identifier id, Collection ids) {
@@ -122,9 +125,9 @@ private boolean acceptRegisterType(Identifier id, PacketContext context, PacketB
/**
* Hook for accepting packets used in Fabric mixins.
*
- * @param id The packet Identifier received.
+ * @param id The packet Identifier received.
* @param context The packet context provided.
- * @param buf The packet data buffer received.
+ * @param buf The packet data buffer received.
* @return Whether or not the packet was handled by this packet registry.
*/
public boolean accept(Identifier id, PacketContext context, PacketByteBuf buf) {
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketTypes.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketTypes.java
index ec384aa92a..5a2e6a4be3 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketTypes.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/PacketTypes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ServerSidePacketRegistryImpl.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ServerSidePacketRegistryImpl.java
index 52215f8f99..8d3e2a50fd 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ServerSidePacketRegistryImpl.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/network/ServerSidePacketRegistryImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStorageAccessor.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStorageAccessor.java
index 35fe593af6..7c12267fcb 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStorageAccessor.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStorageAccessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStreamAccessor.java b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStreamAccessor.java
index 5c0fa102cf..a656b3366f 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStreamAccessor.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/impl/server/EntityTrackerStreamAccessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
package net.fabricmc.fabric.impl.server;
-import net.minecraft.entity.Entity;
import net.minecraft.server.network.ServerPlayerEntity;
import java.util.stream.Stream;
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinClientPlayNetworkHandler.java b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinClientPlayNetworkHandler.java
index cba82f37ae..1f78e65d37 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinClientPlayNetworkHandler.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinClientPlayNetworkHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinCustomPayloadC2SPacket.java b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinCustomPayloadC2SPacket.java
index e7c67c3c54..da0cb085fd 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinCustomPayloadC2SPacket.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinCustomPayloadC2SPacket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinEntityTracker.java b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinEntityTracker.java
index ef0f7e4431..f13b6b660f 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinEntityTracker.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinEntityTracker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinServerPlayNetworkHandler.java b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinServerPlayNetworkHandler.java
index ec617ce6a4..b67b4cd90b 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinServerPlayNetworkHandler.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinServerPlayNetworkHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinThreadedAnvilChunkStorage.java b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinThreadedAnvilChunkStorage.java
index 553759641d..3769f37f5d 100644
--- a/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinThreadedAnvilChunkStorage.java
+++ b/fabric-networking/src/main/java/net/fabricmc/fabric/mixin/network/MixinThreadedAnvilChunkStorage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@
package net.fabricmc.fabric.mixin.network;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
-import net.fabricmc.fabric.impl.server.EntityTrackerStreamAccessor;
import net.fabricmc.fabric.impl.server.EntityTrackerStorageAccessor;
+import net.fabricmc.fabric.impl.server.EntityTrackerStreamAccessor;
import net.minecraft.entity.Entity;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ThreadedAnvilChunkStorage;
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/block/FabricBlockSettings.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/block/FabricBlockSettings.java
index c908422707..99c54ec23f 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/block/FabricBlockSettings.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/block/FabricBlockSettings.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
/**
* Fabric's version of Block.Settings. Adds additional methods and hooks
* not found in the original class.
- *
+ *
* To use it, simply replace Block.Settings.create() with
* FabricBlockSettings.create() and add .build() at the end to return the
* vanilla Block.Settings instance beneath.
@@ -124,7 +124,7 @@ public FabricBlockSettings breakByTool(Tag tag) {
public FabricBlockSettings breakByTool(Tag tag, int miningLevel) {
info.computeIfAbsent(delegate, (k) -> new Information()).miningInformation.add(
- new MiningInformation(tag, miningLevel)
+ new MiningInformation(tag, miningLevel)
);
return this;
}
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/EntityTrackingRegistry.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/EntityTrackingRegistry.java
index 8f486bf080..77cebdecac 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/EntityTrackingRegistry.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/EntityTrackingRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java
index a7adb0b5b4..298627de6c 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/entity/FabricEntityTypeBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/BlockConstructedCallback.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/BlockConstructedCallback.java
index 76d3bf801e..c8338c75fe 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/BlockConstructedCallback.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/BlockConstructedCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/ItemConstructedCallback.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/ItemConstructedCallback.java
index 311439f0b0..1abc06e7d5 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/ItemConstructedCallback.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/api/event/registry/ItemConstructedCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/block/FabricBlockSettingsDelegate.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/block/FabricBlockSettingsDelegate.java
index 4e1e91aa2a..7ef4321177 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/block/FabricBlockSettingsDelegate.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/block/FabricBlockSettingsDelegate.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.fabricmc.fabric.impl.block;
import net.minecraft.block.MaterialColor;
@@ -5,14 +21,23 @@
import net.minecraft.util.Identifier;
public interface FabricBlockSettingsDelegate {
- void fabric_setMaterialColor(MaterialColor color);
- void fabric_setCollidable(boolean value);
- void fabric_setSoundGroup(BlockSoundGroup group);
- void fabric_setLightLevel(int value);
- void fabric_setHardness(float value);
- void fabric_setResistance(float value);
- void fabric_setRandomTicks(boolean value);
- void fabric_setFriction(float value);
- void fabric_setDropTable(Identifier id);
- void fabric_setDynamicBounds(boolean value);
+ void fabric_setMaterialColor(MaterialColor color);
+
+ void fabric_setCollidable(boolean value);
+
+ void fabric_setSoundGroup(BlockSoundGroup group);
+
+ void fabric_setLightLevel(int value);
+
+ void fabric_setHardness(float value);
+
+ void fabric_setResistance(float value);
+
+ void fabric_setRandomTicks(boolean value);
+
+ void fabric_setFriction(float value);
+
+ void fabric_setDropTable(Identifier id);
+
+ void fabric_setDynamicBounds(boolean value);
}
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java
index 657d0fedfc..4b144211dc 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/impl/entity/FabricEntityType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlock.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlock.java
index 7333dc250b..5fdd4cf9e9 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlock.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlock.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlockBuilder.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlockBuilder.java
index a74eb22894..1121420521 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlockBuilder.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinBlockBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinItem.java b/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinItem.java
index a1e56893c0..62aab26c9d 100644
--- a/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinItem.java
+++ b/fabric-object-builders/src/main/java/net/fabricmc/fabric/mixin/builders/MixinItem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ExtendedIdList.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ExtendedIdList.java
index 2fc66062ea..6d19e013eb 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ExtendedIdList.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ExtendedIdList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java
index 4d2e57f333..94d2cf794a 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/FabricRegistryClientInit.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package net.fabricmc.fabric.impl.registry;
import net.fabricmc.api.ClientModInitializer;
@@ -9,20 +25,20 @@
import org.apache.logging.log4j.Logger;
public class FabricRegistryClientInit implements ClientModInitializer {
- private static final Logger LOGGER = LogManager.getLogger();
+ private static final Logger LOGGER = LogManager.getLogger();
- @Override
- public void onInitializeClient() {
- ClientSidePacketRegistry.INSTANCE.register(RegistrySyncManager.ID, (ctx, buf) -> {
- // if not hosting server, apply packet
- RegistrySyncManager.receivePacket(ctx, buf, !MinecraftClient.getInstance().isInSingleplayer(), (e) -> {
- LOGGER.error("Registry remapping failed!", e);
- MinecraftClient.getInstance().execute(() -> {
- ((ClientPlayerEntity) ctx.getPlayer()).networkHandler.getClientConnection().disconnect(
- new StringTextComponent("Registry remapping failed: " + e.getMessage())
- );
- });
- });
- });
- }
+ @Override
+ public void onInitializeClient() {
+ ClientSidePacketRegistry.INSTANCE.register(RegistrySyncManager.ID, (ctx, buf) -> {
+ // if not hosting server, apply packet
+ RegistrySyncManager.receivePacket(ctx, buf, !MinecraftClient.getInstance().isInSingleplayer(), (e) -> {
+ LOGGER.error("Registry remapping failed!", e);
+ MinecraftClient.getInstance().execute(() -> {
+ ((ClientPlayerEntity) ctx.getPlayer()).networkHandler.getClientConnection().disconnect(
+ new StringTextComponent("Registry remapping failed: " + e.getMessage())
+ );
+ });
+ });
+ });
+ }
}
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/IdListUpdater.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/IdListUpdater.java
index 42c5bb0adc..066e79af78 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/IdListUpdater.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/IdListUpdater.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ListenableRegistry.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ListenableRegistry.java
index 40ed214f8f..429ef27162 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ListenableRegistry.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/ListenableRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistryListener.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistryListener.java
index e996b9a988..44cd98caeb 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistryListener.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistryListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,12 @@
import net.minecraft.util.registry.Registry;
public interface RegistryListener {
- default void beforeRegistryCleared(Registry registry) {}
- default void beforeRegistryRegistration(Registry registry, int id, Identifier identifier, T object, boolean isNew) {}
- default void afterRegistryRegistration(Registry registry, int id, Identifier identifier, T object) {}
+ default void beforeRegistryCleared(Registry registry) {
+ }
+
+ default void beforeRegistryRegistration(Registry registry, int id, Identifier identifier, T object, boolean isNew) {
+ }
+
+ default void afterRegistryRegistration(Registry registry, int id, Identifier identifier, T object) {
+ }
}
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistrySyncManager.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistrySyncManager.java
index ac9918e44e..75255155aa 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistrySyncManager.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RegistrySyncManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemapException.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemapException.java
index 91a1e051bf..6deb60a618 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemapException.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemapException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemappableRegistry.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemappableRegistry.java
index 3f93b4f68f..8264ad4128 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemappableRegistry.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/RemappableRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,5 +43,6 @@ enum RemapMode {
}
void remap(Object2IntMap remoteIndexedEntries, RemapMode mode) throws RemapException;
+
void unmap() throws RemapException;
}
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBiomeRegistryListener.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBiomeRegistryListener.java
index 439fef9137..9eb2bf3c61 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBiomeRegistryListener.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBiomeRegistryListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBlockRegistryListener.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBlockRegistryListener.java
index cd7d9f4131..9be7d1cdec 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBlockRegistryListener.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapBlockRegistryListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapFluidRegistryListener.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapFluidRegistryListener.java
index 77b4ac700f..27b870e786 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapFluidRegistryListener.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapFluidRegistryListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapItemRegistryListener.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapItemRegistryListener.java
index d319356cba..26789289b9 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapItemRegistryListener.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/impl/registry/vanilla/BootstrapItemRegistryListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@
package net.fabricmc.fabric.impl.registry.vanilla;
import net.fabricmc.fabric.impl.registry.RegistryListener;
-import net.minecraft.item.Item;
import net.minecraft.item.BlockItem;
+import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinBootstrap.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinBootstrap.java
index fb06b99281..c846b5da9e 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinBootstrap.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinBootstrap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdList.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdList.java
index 944b3299a2..5a269cc32b 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdList.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdList.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdRegistry.java b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdRegistry.java
index df99996035..2d82cdea70 100644
--- a/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdRegistry.java
+++ b/fabric-registry-sync/src/main/java/net/fabricmc/fabric/mixin/registry/MixinIdRegistry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2017, 2018 FabricMC
+ * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
import net.fabricmc.fabric.impl.registry.RemappableRegistry;
import net.minecraft.util.Identifier;
import net.minecraft.util.Int2ObjectBiMap;
-import net.minecraft.util.registry.DefaultedRegistry;
import net.minecraft.util.registry.SimpleRegistry;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
@@ -35,8 +34,6 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-import java.util.*;
-
@Mixin(SimpleRegistry.class)
public abstract class MixinIdRegistry implements RemappableRegistry, ListenableRegistry, RegistryListener {
@Shadow
@@ -55,7 +52,7 @@ public abstract class MixinIdRegistry implements RemappableRegistry, Listenab
@Override
public void registerListener(RegistryListener listener) {
if (fabric_listeners == null) {
- fabric_listeners = new RegistryListener[] { listener };
+ fabric_listeners = new RegistryListener[]{listener};
} else {
RegistryListener[] newListeners = new RegistryListener[fabric_listeners.length + 1];
System.arraycopy(fabric_listeners, 0, newListeners, 0, fabric_listeners.length);
@@ -64,7 +61,7 @@ public void registerListener(RegistryListener listener) {
}
}
- @SuppressWarnings({ "unchecked", "ConstantConditions" })
+ @SuppressWarnings({"unchecked", "ConstantConditions"})
@Inject(method = "set", at = @At("HEAD"))
public void setPre(int id, Identifier identifier, Object object, CallbackInfoReturnable info) {
SimpleRegistry