From 8f13b28ebfaa79fd0885c7a5ce7457eed3ee98ac Mon Sep 17 00:00:00 2001 From: avlad171 Date: Sun, 29 May 2022 19:30:33 +0300 Subject: [PATCH] Cleaned, fix workspace migration errors --- build.gradle | 4 +- gradle.properties | 1 + .../com/myuki69/enderquarry/EnderMarker.java | 1 - .../myuki69/enderquarry/EnderQuarryMod.java | 65 +------------------ .../com/myuki69/enderquarry/InitBlocks.java | 2 - .../myuki69/enderquarry/TileEnderQuarry.java | 17 +++-- src/main/resources/mcmod.info | 2 +- 7 files changed, 15 insertions(+), 77 deletions(-) diff --git a/build.gradle b/build.gradle index 0aa8285..98506a9 100644 --- a/build.gradle +++ b/build.gradle @@ -12,8 +12,8 @@ apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. -version = "1.0.5" -group = "com.yourname.enderquarrymod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +version = "1.1.1" +group = "com.avlad171.enderquarrymod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "enderquarrymod" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. diff --git a/gradle.properties b/gradle.properties index e9b9fd5..878bf1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,4 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G +org.gradle.daemon=false \ No newline at end of file diff --git a/src/main/java/com/myuki69/enderquarry/EnderMarker.java b/src/main/java/com/myuki69/enderquarry/EnderMarker.java index d2d6d6b..8faf3eb 100644 --- a/src/main/java/com/myuki69/enderquarry/EnderMarker.java +++ b/src/main/java/com/myuki69/enderquarry/EnderMarker.java @@ -5,7 +5,6 @@ import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/com/myuki69/enderquarry/EnderQuarryMod.java b/src/main/java/com/myuki69/enderquarry/EnderQuarryMod.java index 63e54fa..3066f91 100644 --- a/src/main/java/com/myuki69/enderquarry/EnderQuarryMod.java +++ b/src/main/java/com/myuki69/enderquarry/EnderQuarryMod.java @@ -24,76 +24,13 @@ public class EnderQuarryMod public static EnderQuarryMod instance; public static final String MODID = "enderquarrymod"; public static final String NAME = "Ender Quarry Mod"; - public static final String VERSION = "1.1.0"; + public static final String VERSION = "1.1.1"; - /*public static EnderQuarry enderQuarry; - public static EnderMarker enderMarker; - public static UpgradeBlock upgradeVoid; - public static UpgradeBlock upgradeSilk; - public static UpgradeBlock upgradeFortune1; - public static UpgradeBlock upgradeFortune2; - public static UpgradeBlock upgradeFortune3; - public static UpgradeBlock upgradeSpeed1; - public static UpgradeBlock upgradeSpeed2; - public static UpgradeBlock upgradeSpeed3; - public static UpgradeBlock upgradePump; - - public static ItemBlock itemEnderQuarry; - public static ItemBlock itemEnderMarker; - public static ItemBlock itemUpgradeVoid; - public static ItemBlock itemUpgradeSilk; - public static ItemBlock itemUpgradeFortune1; - public static ItemBlock itemUpgradeFortune2; - public static ItemBlock itemUpgradeFortune3; - public static ItemBlock itemUpgradeSpeed1; - public static ItemBlock itemUpgradeSpeed2; - public static ItemBlock itemUpgradeSpeed3; - public static ItemBlock itemUpgradePump; - - private void registerUpgrade(UpgradeBlock block, ItemBlock itemblock, String name, int type) - { - block = new UpgradeBlock(name, type); - ForgeRegistries.BLOCKS.register(block); - itemblock = new ItemBlock(block); - itemblock.setRegistryName(block.getRegistryName()); - ForgeRegistries.ITEMS.register(itemblock); - ModelLoader.setCustomModelResourceLocation(itemblock, 0, new ModelResourceLocation(itemblock.getRegistryName(), "inventory")); - } - */ @EventHandler public void preInit(FMLPreInitializationEvent event) { InitBlocks.init(); - /*enderQuarry = new EnderQuarry(); - ForgeRegistries.BLOCKS.register(enderQuarry); - - itemEnderQuarry = new ItemBlock(enderQuarry); - itemEnderQuarry.setRegistryName(enderQuarry.getRegistryName()); - ForgeRegistries.ITEMS.register(itemEnderQuarry); - ModelLoader.setCustomModelResourceLocation(itemEnderQuarry, 0, new ModelResourceLocation(itemEnderQuarry.getRegistryName(), "inventory")); - - GameRegistry.registerTileEntity(TileEnderQuarry.class, enderQuarry.getRegistryName().toString()); - - enderMarker = new EnderMarker(); - ForgeRegistries.BLOCKS.register(enderMarker); - itemEnderMarker = new ItemBlock(enderMarker); - itemEnderMarker.setRegistryName(enderMarker.getRegistryName()); - ForgeRegistries.ITEMS.register(itemEnderMarker); - //ModelLoader.setCustomModelResourceLocation(itemEnderMarker, 0, new ModelResourceLocation(itemEnderMarker.getRegistryName(), "inventory")); - - GameRegistry.registerTileEntity(TileEnderMarker.class, enderMarker.getRegistryName().toString()); - - /*registerUpgrade(upgradeVoid, itemUpgradeVoid, "upgradevoid", 1); - registerUpgrade(upgradeSilk, itemUpgradeSilk, "upgradesilk", 2); - registerUpgrade(upgradeFortune1, itemUpgradeFortune1, "upgradefortunei", 3); - registerUpgrade(upgradeFortune2, itemUpgradeFortune2, "upgradefortuneii", 4); - registerUpgrade(upgradeFortune3, itemUpgradeFortune3, "upgradefortuneiii", 5); - registerUpgrade(upgradeSpeed1, itemUpgradeSpeed1, "upgradespeedi", 6); - registerUpgrade(upgradeSpeed2, itemUpgradeSpeed2, "upgradespeedii", 7); - registerUpgrade(upgradeSpeed3, itemUpgradeSpeed3, "upgradespeediii", 8); - registerUpgrade(upgradePump, itemUpgradePump, "upgradepump", 9); - */ } @EventHandler diff --git a/src/main/java/com/myuki69/enderquarry/InitBlocks.java b/src/main/java/com/myuki69/enderquarry/InitBlocks.java index 1134265..d0a6c2f 100644 --- a/src/main/java/com/myuki69/enderquarry/InitBlocks.java +++ b/src/main/java/com/myuki69/enderquarry/InitBlocks.java @@ -2,9 +2,7 @@ package com.myuki69.enderquarry; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.client.renderer.block.model.ModelResourceLocation; -import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraftforge.client.event.ModelRegistryEvent; diff --git a/src/main/java/com/myuki69/enderquarry/TileEnderQuarry.java b/src/main/java/com/myuki69/enderquarry/TileEnderQuarry.java index 982af52..59ec10d 100644 --- a/src/main/java/com/myuki69/enderquarry/TileEnderQuarry.java +++ b/src/main/java/com/myuki69/enderquarry/TileEnderQuarry.java @@ -51,7 +51,7 @@ public class TileEnderQuarry public static int baseDrain = 1800; public static float hardnessDrain = 200.0F; - public ArrayList items = new ArrayList(); + public ArrayList items = new ArrayList(); public FluidTank tank = new FluidTank(32000); public EnergyStorage energy = new EnergyStorage(10000000); public int neededEnergy = -1; @@ -363,7 +363,6 @@ public class TileEnderQuarry if (!items.isEmpty() && config > 0) { - int side_id = 0; BlockPos thisBlockPos = this.getPos(); for (EnumFacing face : EnumFacing.values()) { @@ -395,9 +394,7 @@ public class TileEnderQuarry if(tile != null && tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, face.getOpposite())) { IFluidHandler handler = tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, face.getOpposite()); - int transfer = tank.getFluidAmount(); - - tank.drain(handler.fill(tank.getFluid(), true), true); + tank.drain(handler.fill(tank.getFluid(), true), true); } } @@ -457,8 +454,6 @@ public class TileEnderQuarry return true; } - //check for tile entities with inventory (chests etc) and extract their items - int meta = toBeMined.getMetaFromState(toBeMinedState); float hardness = toBeMinedState.getBlockHardness(this.world, miningPos); @@ -499,6 +494,14 @@ public class TileEnderQuarry { boolean flag; + //check if item has inventory storage capability + //if so, extract items + TileEntity tile = this.world.getTileEntity(miningPos); + System.out.println("Tile at " + miningPos + ": " + tile); + if(tile != null && tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP)) + { + System.out.println("Found inventory containing tile at " + miningPos); + } Object i = new ArrayList(); if ((digType.isSilkTouch()) && (toBeMined.canSilkHarvest(this.world, miningPos, toBeMinedState, fakePlayer))) diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index a9536cb..56a7c5a 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "enderquarrymod", "name": "Ender Quarry Mod", "description": "Unofficial Ender Quarry port from ExU 1.7.10", - "version": "1.0.5", + "version": "1.1.1", "mcversion": "${mcversion}", "url": "", "updateUrl": "",