Verified Commit b9082269 authored by ParkerMc's avatar ParkerMc
Browse files

Changed stuff

parent 516c7105
Pipeline #77381273 passed with stages
in 5 minutes
package com.parkermc.dropamnesia.droptools; package com.parkermc.dropamnesia.droptools;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
public class ResourceLocationMeta { public class ResourceLocationMeta {
...@@ -10,6 +10,11 @@ public class ResourceLocationMeta { ...@@ -10,6 +10,11 @@ public class ResourceLocationMeta {
this.resourceLocation = resourceLocation; this.resourceLocation = resourceLocation;
} }
public ResourceLocationMeta(IBlockState state) {
this(state.getBlock().getRegistryName());
this.meta = state.getBlock().getMetaFromState(state);
}
public ResourceLocationMeta(ResourceLocation resourceLocation, int meta) { public ResourceLocationMeta(ResourceLocation resourceLocation, int meta) {
this(resourceLocation); this(resourceLocation);
this.meta = meta; this.meta = meta;
......
...@@ -22,7 +22,7 @@ public class EventBlockHarvest { ...@@ -22,7 +22,7 @@ public class EventBlockHarvest {
@SubscribeEvent @SubscribeEvent
public void onBlockHarvest(BlockEvent.HarvestDropsEvent event) { public void onBlockHarvest(BlockEvent.HarvestDropsEvent event) {
if(!drops.contains(event.getPos())) { if(!drops.contains(event.getPos())) {
ResourceLocationMeta dropBlockLocation = DropManager.instance.getDropBlock(new ResourceLocationMeta(event.getState().getBlock().getRegistryName(), event.getState().getBlock().getMetaFromState(event.getState()))); ResourceLocationMeta dropBlockLocation = DropManager.instance.getDropBlock(new ResourceLocationMeta(event.getState()));
if(dropBlockLocation != null&&ForgeRegistries.BLOCKS.containsKey(dropBlockLocation.getResourceLocation())) { if(dropBlockLocation != null&&ForgeRegistries.BLOCKS.containsKey(dropBlockLocation.getResourceLocation())) {
Block dropBlock = ForgeRegistries.BLOCKS.getValue(dropBlockLocation.getResourceLocation()); Block dropBlock = ForgeRegistries.BLOCKS.getValue(dropBlockLocation.getResourceLocation());
if(!(event.isSilkTouching()&&!ProxyCommon.config.silk_touch_drop_random)) { if(!(event.isSilkTouching()&&!ProxyCommon.config.silk_touch_drop_random)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment