inital 19w46a port

This commit is contained in:
modmuss50 2019-11-14 18:37:42 +00:00
parent 3fe62e2c77
commit a984263b04
48 changed files with 356 additions and 339 deletions

View file

@ -116,7 +116,7 @@ public class ItemDynamicCell extends Item implements ItemFluidInfo {
@Override
public Fluid getFluid(ItemStack itemStack) {
CompoundTag tag = itemStack.getTag();
if(tag != null && tag.containsKey("fluid")){
if(tag != null && tag.contains("fluid")){
return Registry.FLUID.get(new Identifier(tag.getString("fluid")));
}
return Fluids.EMPTY;

View file

@ -60,8 +60,8 @@ public class ItemFrequencyTransmitter extends Item {
@Override
@Environment(EnvType.CLIENT)
public float call(ItemStack stack, @Nullable World worldIn, @Nullable LivingEntity entityIn) {
if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().containsKey("x")
&& stack.getTag().containsKey("y") && stack.getTag().containsKey("z") && stack.getTag().containsKey("dim")) {
if (!stack.isEmpty() && stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x")
&& stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
return 1.0F;
}
return 0.0F;
@ -109,13 +109,13 @@ public class ItemFrequencyTransmitter extends Item {
}
}
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
}
@Environment(EnvType.CLIENT)
@Override
public void appendTooltip(ItemStack stack, @Nullable World worldIn, List<Text> tooltip, TooltipContext flagIn) {
if (stack.hasTag() && stack.getTag() != null && stack.getTag().containsKey("x") && stack.getTag().containsKey("y") && stack.getTag().containsKey("z") && stack.getTag().containsKey("dim")) {
if (stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x") && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
int x = stack.getTag().getInt("x");
int y = stack.getTag().getInt("y");
int z = stack.getTag().getInt("z");
@ -146,7 +146,7 @@ public class ItemFrequencyTransmitter extends Item {
Formatting gold = Formatting.GOLD;
Formatting grey = Formatting.GRAY;
if (stack.getItem() instanceof ItemFrequencyTransmitter) {
if (stack.hasTag() && stack.getTag() != null && stack.getTag().containsKey("x") && stack.getTag().containsKey("y") && stack.getTag().containsKey("z") && stack.getTag().containsKey("dim")) {
if (stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x") && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
int coordX = stack.getTag().getInt("x");
int coordY = stack.getTag().getInt("y");
int coordZ = stack.getTag().getInt("z");

View file

@ -49,7 +49,7 @@ public class ItemManual extends Item {
if(world.isClient){
openGui(player);
}
return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand), true);
return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand));
}
@Environment(EnvType.CLIENT)

View file

@ -54,6 +54,6 @@ public class ItemScrapBox extends Item {
WorldUtils.dropItem(out, world, player.getBlockPos());
stack.decrement(1);
}
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
}
}

View file

@ -34,7 +34,7 @@ import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Formatting;
import net.minecraft.util.SystemUtil;
import net.minecraft.util.Util;
import net.minecraft.util.registry.Registry;
import reborncore.common.powerSystem.PowerSystem;
import team.reborn.energy.Energy;
@ -81,7 +81,7 @@ public class ItemDebugTool extends Item {
private String getPropertyString(Entry<Property<?>, Comparable<?>> entryIn) {
Property<?> iproperty = entryIn.getKey();
Comparable<?> comparable = entryIn.getValue();
String s = SystemUtil.getValueAsString(iproperty, comparable);
String s = Util.getValueAsString(iproperty, comparable);
if (Boolean.TRUE.equals(comparable)) {
s = Formatting.GREEN + s;
} else if (Boolean.FALSE.equals(comparable)) {

View file

@ -26,6 +26,7 @@ package techreborn.items.tool;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.LivingEntity;
@ -61,7 +62,7 @@ public class ItemJackhammer extends PickaxeItem implements EnergyHolder, ItemDur
// ItemPickaxe
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
if (Block.isNaturalStone(state.getBlock()) && Energy.of(stack).getEnergy() >= cost) {
if (state.getMaterial() == Material.STONE && Energy.of(stack).getEnergy() >= cost) {
return miningSpeed;
} else {
return 0.5F;

View file

@ -141,9 +141,9 @@ public class ItemIndustrialChainsaw extends ItemChainsaw {
}
}
}
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
}
return new TypedActionResult<>(ActionResult.PASS, stack, true);
return new TypedActionResult<>(ActionResult.PASS, stack);
}
@Override

View file

@ -197,9 +197,9 @@ public class ItemIndustrialDrill extends ItemDrill {
}
}
}
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
}
return new TypedActionResult<>(ActionResult.PASS, stack, true);
return new TypedActionResult<>(ActionResult.PASS, stack);
}
@Override

View file

@ -134,9 +134,9 @@ public class ItemNanosaber extends SwordItem implements EnergyHolder, ItemDurabi
}
}
}
return new TypedActionResult<>(ActionResult.SUCCESS, stack, true);
return new TypedActionResult<>(ActionResult.SUCCESS, stack);
}
return new TypedActionResult<>(ActionResult.PASS, stack, true);
return new TypedActionResult<>(ActionResult.PASS, stack);
}
@Override