Skip to content

Commit

Permalink
final changes b4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ANightDazingZoroark committed Apr 2, 2024
1 parent 9a46a3b commit 7eaa98d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

Expand Down Expand Up @@ -111,4 +112,8 @@ public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, Ent
}
super.onBlockHarvested(worldIn, pos, state, player);
}

public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return new ItemStack(RiftMMItems.BLOW_POWERED_TURBINE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class RiftMMBlocks {
public static Block BLOW_POWERED_TURBINE;

public static void registerMMBlocks() {
LEAD_POWERED_CRANK = RiftBlocks.registerBlock(new BlockLeadPoweredCrank(), "lead_powered_crank", true);
LEAD_POWERED_CRANK = RiftBlocks.registerBlock(new BlockLeadPoweredCrank(), "lead_powered_crank", true, false);
BLOW_POWERED_TURBINE = RiftBlocks.registerBlock(new BlockBlowPoweredTurbine(), "blow_powered_turbine", false);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package anightdazingzoroark.prift.compat.mysticalmechanics.items;

import anightdazingzoroark.prift.server.items.RiftItems;
import anightdazingzoroark.prift.server.items.RiftLargeWeaponItem;
import net.minecraft.item.Item;

public class RiftMMItems {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@ public static void registerBlocks() {
}

public static Block registerBlock(Block block, String registryName, boolean includeItem) {
return registerBlock(block, registryName, includeItem, true);
}

public static Block registerBlock(Block block, String registryName, boolean includeItem, boolean itemStackable) {
block.setCreativeTab(RiftCreativeTabs.creativeItemsTab);
block.setRegistryName(registryName);
block.setTranslationKey(registryName);
BLOCKS.add(block);
if (includeItem) ITEM_BLOCKS.add((ItemBlock)(new ItemBlock(block).setRegistryName(registryName).setTranslationKey(registryName)));
if (includeItem) {
ItemBlock itemBlock = new ItemBlock(block);
itemBlock.setRegistryName(registryName);
itemBlock.setTranslationKey(registryName);
if (!itemStackable) itemBlock.setMaxStackSize(1);
ITEM_BLOCKS.add(itemBlock);
}
return block;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockBlowPoweredTurbine;
import anightdazingzoroark.prift.compat.mysticalmechanics.blocks.BlockLeadPoweredCrank;
import anightdazingzoroark.prift.compat.mysticalmechanics.tileentities.TileEntityBlowPoweredTurbine;
import anightdazingzoroark.prift.config.DimetrodonConfig;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.config.MegapiranhaConfig;
import anightdazingzoroark.prift.server.entity.interfaces.ILeadWorkstationUser;
import anightdazingzoroark.prift.server.enums.TameStatusType;
import com.codetaylor.mc.athenaeum.util.Properties;
import anightdazingzoroark.prift.RiftInitialize;
import anightdazingzoroark.prift.RiftUtil;
import anightdazingzoroark.prift.client.RiftSounds;
Expand All @@ -20,6 +17,7 @@
import com.codetaylor.mc.pyrotech.modules.tech.machine.tile.spi.TileCombustionWorkerStoneBase;
import com.google.common.base.Predicate;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.entity.*;
Expand Down Expand Up @@ -382,7 +380,7 @@ public BlockPos workstationUseFromPos() {
if (te != null) downF = te instanceof TileEntityBlowPoweredTurbine ? -1 : 0;
}
if (blockState.getMaterial().isSolid()) {
EnumFacing direction = blockState.getValue(Properties.FACING_HORIZONTAL);
EnumFacing direction = blockState.getValue(BlockHorizontal.FACING);
switch (direction) {
case NORTH:
return this.getWorkstationPos().add(0, downF, -4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
import anightdazingzoroark.prift.server.entity.interfaces.IApexPredator;
import anightdazingzoroark.prift.server.entity.interfaces.IWorkstationUser;
import anightdazingzoroark.prift.server.enums.TameStatusType;
import com.codetaylor.mc.athenaeum.util.Properties;
import com.codetaylor.mc.pyrotech.modules.tech.machine.block.spi.BlockCombustionWorkerStoneBase;
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.culling.ICamera;
Expand Down Expand Up @@ -429,7 +428,7 @@ public BlockPos workstationUseFromPos() {
if (te != null) downF = te instanceof TileEntityBlowPoweredTurbine ? -1 : 0;
}
if (blockState.getMaterial().isSolid()) {
EnumFacing direction = blockState.getValue(Properties.FACING_HORIZONTAL);
EnumFacing direction = blockState.getValue(BlockHorizontal.FACING);
switch (direction) {
case NORTH:
return this.getWorkstationPos().add(0, downF, -4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import anightdazingzoroark.prift.client.creativetab.RiftCreativeTabs;
import anightdazingzoroark.prift.compat.mysticalmechanics.items.RiftMMItems;
import anightdazingzoroark.prift.config.GeneralConfig;
import anightdazingzoroark.prift.server.entity.RiftCreatureType;
import anightdazingzoroark.prift.server.entity.RiftLargeWeaponType;
import anightdazingzoroark.prift.server.entity.projectile.RiftProjectiles;
Expand Down Expand Up @@ -137,7 +138,7 @@ public static void registerItems() {
RiftCreatureType.registerSacs();

//compat items
RiftMMItems.registerMMItems();
if (GeneralConfig.canUseMM()) RiftMMItems.registerMMItems();

//dont ask why this is here
RiftProjectiles.registerProjectiles();
Expand Down

0 comments on commit 7eaa98d

Please sign in to comment.