From d9445d26d5b22873a9d910992a11df94a6c082c8 Mon Sep 17 00:00:00 2001 From: tom5454 Date: Mon, 27 Apr 2020 19:24:08 +0200 Subject: [PATCH] v1.0.2 Update Fixed crash --- build.gradle | 2 +- .../java/com/tom/storagemod/StorageMod.java | 33 +++---------------- .../block/TileEntityInventoryConnector.java | 4 ++- version-check.json | 5 +-- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/build.gradle b/build.gradle index 653f1643..c1563cc1 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '1.0.0' +version = '1.0.2' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'toms_storage' diff --git a/src/main/java/com/tom/storagemod/StorageMod.java b/src/main/java/com/tom/storagemod/StorageMod.java index a51186df..d2dc5b79 100644 --- a/src/main/java/com/tom/storagemod/StorageMod.java +++ b/src/main/java/com/tom/storagemod/StorageMod.java @@ -17,6 +17,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @@ -57,47 +58,21 @@ public StorageMod() { // Register the processIMC method for modloading //FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading - //FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } - private void setup(final FMLCommonSetupEvent event) - { - // some preinit code + private void setup(final FMLCommonSetupEvent event) { LOGGER.info("Tom's Storage Setup starting"); proxy.setup(); } - /*private void doClientStuff(final FMLClientSetupEvent event) { - // do something that can only be done on the client - //LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings); + private void doClientStuff(final FMLClientSetupEvent event) { proxy.clientSetup(); - - } - - private void enqueueIMC(final InterModEnqueueEvent event) - { - // some example code to dispatch IMC to another mod - //InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";}); } - private void processIMC(final InterModProcessEvent event) - { - // some example code to receive and process InterModComms from other mods - LOGGER.info("Got IMC {}", event.getIMCStream(). - map(m->m.getMessageSupplier().get()). - collect(Collectors.toList())); - }*/ - // You can use SubscribeEvent and let the Event Bus discover methods to call - - /*@SubscribeEvent - public void onServerStarting(FMLServerStartingEvent event) { - // do something when the server starts - //LOGGER.info("HELLO from server starting"); - }*/ - // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) diff --git a/src/main/java/com/tom/storagemod/block/TileEntityInventoryConnector.java b/src/main/java/com/tom/storagemod/block/TileEntityInventoryConnector.java index 3285ef29..05a5164d 100644 --- a/src/main/java/com/tom/storagemod/block/TileEntityInventoryConnector.java +++ b/src/main/java/com/tom/storagemod/block/TileEntityInventoryConnector.java @@ -52,7 +52,9 @@ public void tick() { if(!checkedBlocks.contains(p) && p.distanceSq(pos) < 256) { checkedBlocks.add(p); TileEntity te = world.getTileEntity(p); - if(te != null) { + if (te instanceof TileEntityInventoryConnector) { + continue; + } else if(te != null) { LazyOptional inv = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, d.getOpposite()); if(te instanceof ChestTileEntity) {//Check for double chests BlockState state = world.getBlockState(p); diff --git a/version-check.json b/version-check.json index 7abe54b2..b323638d 100644 --- a/version-check.json +++ b/version-check.json @@ -1,10 +1,11 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/toms-storage", "promos": { - "1.15.2-latest": "1.0.1", - "1.15.2-recommended": "1.0.1" + "1.15.2-latest": "1.0.2", + "1.15.2-recommended": "1.0.2" }, "1.15.2": { + "1.0.2": "Fixed crash", "1.0.1": "Fixed loot tables", "1.0.0": "First release" }