Small cleanup

This commit is contained in:
drcrazy 2020-07-18 19:30:08 +03:00
parent 01663648c4
commit 90521007bb
5 changed files with 5 additions and 123 deletions

View file

@ -1,40 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2020 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client;
public class ClientEventHandler {
//TODO 1.14
// @SubscribeEvent
// public static void renderPlayer(RenderPlayerEvent.Pre event) {
// PlayerEntity player = event.getEntityPlayer();
// Item chestslot = !player.getEquippedStack(EquipmentSlot.CHEST).isEmpty()
// ? player.getEquippedStack(EquipmentSlot.CHEST).getItem() : null;
// if (chestslot != null && chestslot == TRContent.CLOAKING_DEVICE) {
// event.setCanceled(true);
// }
// }
}

View file

@ -24,14 +24,15 @@
package techreborn.events;
import net.minecraft.block.*;
import net.minecraft.block.FenceBlock;
import net.minecraft.block.FenceGateBlock;
import net.minecraft.block.PillarBlock;
import net.minecraft.block.SlabBlock;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.Item.Settings;
import net.minecraft.item.Items;
import net.minecraft.item.ToolMaterials;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.math.Direction;
import reborncore.RebornRegistry;
import team.reborn.energy.EnergyTier;
import techreborn.TechReborn;
@ -211,12 +212,6 @@ public class ModRegistry {
TechReborn.LOGGER.debug("TechReborns Items Loaded");
}
private static PillarBlock createLogBlock(MaterialColor topMaterialColor, MaterialColor sideMaterialColor) {
return new PillarBlock(AbstractBlock.Settings.of(Material.WOOD, (blockState) -> {
return blockState.get(PillarBlock.AXIS) == Direction.Axis.Y ? topMaterialColor : sideMaterialColor;
}).strength(2.0F).sounds(BlockSoundGroup.WOOD));
}
private static void registerFluids() {
Arrays.stream(ModFluids.values()).forEach(ModFluids::register);
}

View file

@ -24,7 +24,6 @@
package techreborn.events;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.Recipe;
import net.minecraft.recipe.RecipeType;
import net.minecraft.server.network.ServerPlayerEntity;
@ -34,7 +33,6 @@ import techreborn.utils.RecipeUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
public class TRRecipeHandler {

View file

@ -224,9 +224,7 @@ public class ServerboundPackets {
}
public static Packet<ServerPlayPacketListener> createPacketExperience(IronFurnaceBlockEntity blockEntity) {
return NetworkManager.createServerBoundPacket(EXPERIENCE, extendedPacketBuffer -> {
extendedPacketBuffer.writeBlockPos(blockEntity.getPos());
});
return NetworkManager.createServerBoundPacket(EXPERIENCE, extendedPacketBuffer -> extendedPacketBuffer.writeBlockPos(blockEntity.getPos()));
}
}

View file

@ -25,16 +25,12 @@
package techreborn.utils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagContainer;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class TagUtils {
public static <T> boolean hasTag(T type, Tag<T> tag) {
@ -52,69 +48,4 @@ public class TagUtils {
public static TagContainer<Fluid> getAllFluidTags(World world) {
return world.getTagManager().fluids();
}
public static String toFirstLower(String string) {
if (string == null || string.isEmpty())
return string;
return Character.toLowerCase(string.charAt(0)) + string.substring(1);
}
public static String toFirstUpper(String string) {
if (string.isEmpty())
return string;
return Character.toUpperCase(string.charAt(0)) + string.substring(1);
}
public static String joinDictName(String prefix, String name) {
return prefix + toFirstUpper(name);
}
public static String[] getDictData(String prefixed) {
StringBuilder prefixBuilder = new StringBuilder();
StringBuilder nameBuilder = new StringBuilder();
boolean prefixFinished = false;
for (int i = 0; i < prefixed.length(); i++) {
char charAt = prefixed.charAt(i);
if (!prefixFinished) {
if (Character.isUpperCase(charAt)) {
nameBuilder.append(Character.toLowerCase(charAt));
prefixFinished = true;
} else
prefixBuilder.append(charAt);
} else
nameBuilder.append(charAt);
}
return new String[]{
prefixBuilder.toString(),
nameBuilder.toString()
};
}
public static boolean isDictPrefixed(String name, String... prefixes) {
for (String prefix : prefixes)
if (name.startsWith(prefix))
return true;
return false;
}
@Deprecated
@Nonnull
public static ItemStack getDictOreOrEmpty(String name, int amount) {
throw new UnsupportedOperationException("Move to tags");
}
@Deprecated
public static boolean isOre(BlockState state, String oreName) {
throw new UnsupportedOperationException("Move to tags");
}
@Deprecated
public static boolean isOre(
@Nonnull
ItemStack stack, String oreName) {
throw new UnsupportedOperationException("Move to tags");
}
}