Small tweaks + cleanup
This commit is contained in:
parent
70279c1800
commit
858adafead
4 changed files with 11 additions and 156 deletions
|
@ -40,20 +40,16 @@ import reborncore.common.util.Torus;
|
||||||
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
|
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.events.ModRegistry;
|
import techreborn.events.ModRegistry;
|
||||||
import techreborn.events.StackToolTipHandler;
|
|
||||||
import techreborn.init.*;
|
import techreborn.init.*;
|
||||||
import techreborn.packets.ClientboundPackets;
|
import techreborn.packets.ClientboundPackets;
|
||||||
import techreborn.packets.ServerboundPackets;
|
import techreborn.packets.ServerboundPackets;
|
||||||
import techreborn.proxies.CommonProxy;
|
|
||||||
import techreborn.utils.BehaviorDispenseScrapbox;
|
import techreborn.utils.BehaviorDispenseScrapbox;
|
||||||
import techreborn.utils.StackWIPHandler;
|
|
||||||
import techreborn.world.WorldGenerator;
|
import techreborn.world.WorldGenerator;
|
||||||
|
|
||||||
public class TechReborn implements ModInitializer {
|
public class TechReborn implements ModInitializer {
|
||||||
|
|
||||||
public static final String MOD_ID = "techreborn";
|
public static final String MOD_ID = "techreborn";
|
||||||
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
|
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
|
||||||
public static CommonProxy proxy = new CommonProxy();
|
|
||||||
public static TechReborn INSTANCE;
|
public static TechReborn INSTANCE;
|
||||||
|
|
||||||
public static ItemGroup ITEMGROUP = FabricItemGroupBuilder.build(
|
public static ItemGroup ITEMGROUP = FabricItemGroupBuilder.build(
|
||||||
|
@ -76,11 +72,6 @@ public class TechReborn implements ModInitializer {
|
||||||
RecipeCrafter.soundHanlder = new ModSounds.SoundHandler();
|
RecipeCrafter.soundHanlder = new ModSounds.SoundHandler();
|
||||||
ModLoot.init();
|
ModLoot.init();
|
||||||
|
|
||||||
proxy.preInit();
|
|
||||||
|
|
||||||
// Client only init, needs to be done before parts system
|
|
||||||
proxy.init();
|
|
||||||
|
|
||||||
// WorldGen
|
// WorldGen
|
||||||
WorldGenerator.initBiomeFeatures();
|
WorldGenerator.initBiomeFeatures();
|
||||||
|
|
||||||
|
@ -110,9 +101,6 @@ public class TechReborn implements ModInitializer {
|
||||||
|
|
||||||
Torus.genSizeMap(FusionControlComputerBlockEntity.maxCoilSize);
|
Torus.genSizeMap(FusionControlComputerBlockEntity.maxCoilSize);
|
||||||
|
|
||||||
proxy.postInit();
|
|
||||||
|
|
||||||
|
|
||||||
CommandRegistry.INSTANCE.register(false, dispatcher -> dispatcher.register(CommandManager.literal("recipe").executes(context -> {
|
CommandRegistry.INSTANCE.register(false, dispatcher -> dispatcher.register(CommandManager.literal("recipe").executes(context -> {
|
||||||
try {
|
try {
|
||||||
RecipeTemplate.generateFromInv(context.getSource().getPlayer());
|
RecipeTemplate.generateFromInv(context.getSource().getPlayer());
|
||||||
|
|
|
@ -32,9 +32,15 @@ import net.minecraft.client.render.model.ModelLoader;
|
||||||
import net.minecraft.client.render.model.UnbakedModel;
|
import net.minecraft.client.render.model.UnbakedModel;
|
||||||
import net.minecraft.client.texture.Sprite;
|
import net.minecraft.client.texture.Sprite;
|
||||||
import net.minecraft.client.util.ModelIdentifier;
|
import net.minecraft.client.util.ModelIdentifier;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import reborncore.client.gui.builder.GuiBase;
|
||||||
|
import reborncore.client.hud.StackInfoHUD;
|
||||||
import techreborn.client.render.DynamicCellBakedModel;
|
import techreborn.client.render.DynamicCellBakedModel;
|
||||||
import techreborn.events.StackToolTipHandler;
|
import techreborn.events.StackToolTipHandler;
|
||||||
|
import techreborn.init.TRContent;
|
||||||
|
import techreborn.items.ItemDynamicCell;
|
||||||
|
import techreborn.items.ItemFrequencyTransmitter;
|
||||||
import techreborn.utils.StackWIPHandler;
|
import techreborn.utils.StackWIPHandler;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
@ -82,6 +88,11 @@ public class TechRebornClient implements ClientModInitializer {
|
||||||
|
|
||||||
StackToolTipHandler.setup();
|
StackToolTipHandler.setup();
|
||||||
StackWIPHandler.setup();
|
StackWIPHandler.setup();
|
||||||
|
|
||||||
|
GuiBase.wrenchStack = new ItemStack(TRContent.WRENCH);
|
||||||
|
GuiBase.fluidCellProvider = ItemDynamicCell::getCellWithFluid;
|
||||||
|
|
||||||
|
StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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<EntityNukePrimed> {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public EntityRenderer<? super EntityNukePrimed> createRenderFor(EntityRenderDispatcher manager) {
|
|
||||||
// return new RenderNukePrimed(manager);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean fancyGraphics() {
|
|
||||||
return MinecraftClient.getInstance().options.fancyGraphics;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue