From 858adafead24427463b40d6c656ef284807d7ee6 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 31 Jul 2019 20:50:17 +0100 Subject: [PATCH] Small tweaks + cleanup --- src/main/java/techreborn/TechReborn.java | 12 --- .../java/techreborn/TechRebornClient.java | 11 +++ .../java/techreborn/proxies/ClientProxy.java | 89 ------------------- .../java/techreborn/proxies/CommonProxy.java | 55 ------------ 4 files changed, 11 insertions(+), 156 deletions(-) delete mode 100644 src/main/java/techreborn/proxies/ClientProxy.java delete mode 100644 src/main/java/techreborn/proxies/CommonProxy.java diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index 5bd58b377..6a988b721 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -40,20 +40,16 @@ import reborncore.common.util.Torus; import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity; import techreborn.client.GuiHandler; import techreborn.events.ModRegistry; -import techreborn.events.StackToolTipHandler; import techreborn.init.*; import techreborn.packets.ClientboundPackets; import techreborn.packets.ServerboundPackets; -import techreborn.proxies.CommonProxy; import techreborn.utils.BehaviorDispenseScrapbox; -import techreborn.utils.StackWIPHandler; import techreborn.world.WorldGenerator; public class TechReborn implements ModInitializer { public static final String MOD_ID = "techreborn"; public static final Logger LOGGER = LogManager.getLogger(MOD_ID); - public static CommonProxy proxy = new CommonProxy(); public static TechReborn INSTANCE; public static ItemGroup ITEMGROUP = FabricItemGroupBuilder.build( @@ -75,11 +71,6 @@ public class TechReborn implements ModInitializer { ModRegistry.setupShit(); RecipeCrafter.soundHanlder = new ModSounds.SoundHandler(); ModLoot.init(); - - proxy.preInit(); - - // Client only init, needs to be done before parts system - proxy.init(); // WorldGen WorldGenerator.initBiomeFeatures(); @@ -110,9 +101,6 @@ public class TechReborn implements ModInitializer { Torus.genSizeMap(FusionControlComputerBlockEntity.maxCoilSize); - proxy.postInit(); - - CommandRegistry.INSTANCE.register(false, dispatcher -> dispatcher.register(CommandManager.literal("recipe").executes(context -> { try { RecipeTemplate.generateFromInv(context.getSource().getPlayer()); diff --git a/src/main/java/techreborn/TechRebornClient.java b/src/main/java/techreborn/TechRebornClient.java index f962659bd..959eaac44 100644 --- a/src/main/java/techreborn/TechRebornClient.java +++ b/src/main/java/techreborn/TechRebornClient.java @@ -32,9 +32,15 @@ import net.minecraft.client.render.model.ModelLoader; import net.minecraft.client.render.model.UnbakedModel; import net.minecraft.client.texture.Sprite; import net.minecraft.client.util.ModelIdentifier; +import net.minecraft.item.ItemStack; import net.minecraft.util.Identifier; +import reborncore.client.gui.builder.GuiBase; +import reborncore.client.hud.StackInfoHUD; import techreborn.client.render.DynamicCellBakedModel; import techreborn.events.StackToolTipHandler; +import techreborn.init.TRContent; +import techreborn.items.ItemDynamicCell; +import techreborn.items.ItemFrequencyTransmitter; import techreborn.utils.StackWIPHandler; import javax.annotation.Nullable; @@ -82,6 +88,11 @@ public class TechRebornClient implements ClientModInitializer { StackToolTipHandler.setup(); StackWIPHandler.setup(); + + GuiBase.wrenchStack = new ItemStack(TRContent.WRENCH); + GuiBase.fluidCellProvider = ItemDynamicCell::getCellWithFluid; + + StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter()); } diff --git a/src/main/java/techreborn/proxies/ClientProxy.java b/src/main/java/techreborn/proxies/ClientProxy.java deleted file mode 100644 index 03c873b38..000000000 --- a/src/main/java/techreborn/proxies/ClientProxy.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.proxies; - -import net.minecraft.util.Formatting; -import net.minecraft.client.MinecraftClient; -import net.minecraft.item.ItemStack; -import reborncore.api.blockentity.IUpgradeable; -import reborncore.client.gui.builder.GuiBase; -import reborncore.client.hud.StackInfoHUD; -import techreborn.init.TRContent; -import techreborn.items.ItemDynamicCell; -import techreborn.items.ItemFrequencyTransmitter; - -public class ClientProxy extends CommonProxy { - - @Override - public void preInit() { - super.preInit(); - StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter()); -// RenderingRegistry.registerEntityRenderingHandler(EntityNukePrimed.class, new RenderManagerNuke()); -// MinecraftForge.EVENT_BUS.register(new IconSupplier()); -// MinecraftForge.EVENT_BUS.register(ClientEventHandler.class); - } - - @Override - public void init() { - super.init(); -// MinecraftForge.EVENT_BUS.register(new StackToolTipEvent()); -// MinecraftForge.EVENT_BUS.register(GuiSlotConfiguration.class); -// MinecraftForge.EVENT_BUS.register(GuiFluidConfiguration.class); - // TODO FIX ME - //ClientRegistry.registerKeyBinding(KeyBindings.config); -// StateMap rubberLeavesStateMap = new StateMap.Builder().ignore(BlockRubberLeaves.CHECK_DECAY, BlockRubberLeaves.DECAYABLE).build(); -// ModelLoader.setCustomStateMapper(TRContent.RUBBER_LEAVES, rubberLeavesStateMap); - GuiBase.wrenchStack = new ItemStack(TRContent.WRENCH); - GuiBase.fluidCellProvider = ItemDynamicCell::getCellWithFluid; - } - - - @Override - public String getUpgradeConfigText() { - if (MinecraftClient.getInstance().currentScreen instanceof GuiBase) { - GuiBase base = (GuiBase) MinecraftClient.getInstance().currentScreen; - if (base.blockEntity instanceof IUpgradeable) { - if (((IUpgradeable) base.blockEntity).canBeUpgraded()) { - return Formatting.LIGHT_PURPLE + "Right click to configure"; - } - } - } - return super.getUpgradeConfigText(); - } - -// public class RenderManagerNuke implements IRenderFactory { -// -// @Override -// public EntityRenderer createRenderFor(EntityRenderDispatcher manager) { -// return new RenderNukePrimed(manager); -// } -// } - - @Override - public boolean fancyGraphics() { - return MinecraftClient.getInstance().options.fancyGraphics; - } - -} diff --git a/src/main/java/techreborn/proxies/CommonProxy.java b/src/main/java/techreborn/proxies/CommonProxy.java deleted file mode 100644 index 8a98ee5f4..000000000 --- a/src/main/java/techreborn/proxies/CommonProxy.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.proxies; - - -public class CommonProxy { - - public void preInit() { - - } - - public void init() { - - } - - public void postInit() { - - } - - public void serverStarting() { - - } - - public String getUpgradeConfigText() { - return ""; - } - - public boolean fancyGraphics(){ - return true; - } - - -}