initial 20w11a

This commit is contained in:
modmuss50 2020-03-12 20:32:03 +00:00
parent dffec285b2
commit adad632549
25 changed files with 65 additions and 71 deletions

View file

@ -65,15 +65,15 @@ license {
group = 'TechReborn'
dependencies {
minecraft "com.mojang:minecraft:20w06a"
mappings "net.fabricmc:yarn:20w06a+build.15:v2"
modImplementation "net.fabricmc:fabric-loader:0.7.8+build.184"
minecraft "com.mojang:minecraft:20w11a"
mappings "net.fabricmc:yarn:20w11a+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.7.8+build.187"
//Fabric api
modImplementation "net.fabricmc.fabric-api:fabric-api:0.4.32+build.296-1.16"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.5.3+build.308-1.16"
optionalDependency ("me.shedaniel:RoughlyEnoughItems:3.2.31")
optionalDependency ('io.github.cottonmc:LibCD:2.0.1+1.15')
optionalDependency ("me.shedaniel:RoughlyEnoughItems:4.0.12-unstable")
optionalDependency ('io.github.cottonmc:LibCD:2.3.0+1.15.2')
def rcVersion = 'RebornCore:RebornCore-1.16:+'
modApi (rcVersion) {
@ -85,10 +85,6 @@ dependencies {
modCompileOnly ('curse.maven:towelette:2842017') {
transitive = false
}
modRuntime ("com.jamieswhiteshirt:developer-mode:1.0.15") {
transitive = false
}
}
def optionalDependency(String dep) {

View file

@ -24,7 +24,6 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
@ -33,6 +32,7 @@ import net.minecraft.recipe.CraftingRecipe;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.Recipe;
import net.minecraft.recipe.RecipeType;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.sound.SoundCategory;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.math.Direction;
@ -101,7 +101,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
public CraftingInventory getCraftingInventory() {
if (inventoryCrafting == null) {
inventoryCrafting = new CraftingInventory(new Container(null, -1) {
inventoryCrafting = new CraftingInventory(new ScreenHandler(null, -1) {
@Override
public boolean canUse(PlayerEntity playerIn) {
return false;

View file

@ -24,12 +24,12 @@
package techreborn.blockentity.machine.tier1;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.recipe.Ingredient;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
import org.apache.commons.lang3.tuple.Pair;
@ -414,7 +414,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
return 0;
}
private static class RollingBEContainer extends Container {
private static class RollingBEContainer extends ScreenHandler {
protected RollingBEContainer() {
super(null, 0);

View file

@ -86,7 +86,7 @@ public class BlockRubberLog extends LogBlock {
}
@Override
public boolean matches(Tag<Block> tagIn) {
public boolean isIn(Tag<Block> tagIn) {
return tagIn == BlockTags.LOGS;
}

View file

@ -29,7 +29,7 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.screen.ScreenProviderRegistry;
import net.fabricmc.fabric.api.container.ContainerProviderRegistry;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.gui.screen.ingame.ContainerScreen;
import net.minecraft.client.gui.screen.ingame.ScreenWithHandler;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import reborncore.RebornCore;
@ -74,7 +74,7 @@ public class GuiHandler {
}
@Environment(EnvType.CLIENT)
private static ContainerScreen<?> getClientGuiElement(final EGui gui, final PlayerEntity player, BlockPos pos, int syncID) {
private static ScreenWithHandler<?> getClientGuiElement(final EGui gui, final PlayerEntity player, BlockPos pos, int syncID) {
final BlockEntity blockEntity = player.world.getBlockEntity(pos);
if (blockEntity instanceof DataDrivenBEProvider.DataDrivenBlockEntity) {

View file

@ -24,15 +24,15 @@
package techreborn.client.container;
import net.minecraft.container.Container;
import net.minecraft.container.Slot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import reborncore.client.gui.slots.SlotFilteredVoid;
import reborncore.common.util.RebornInventory;
import techreborn.init.TRContent;
public class ContainerDestructoPack extends Container {
public class ContainerDestructoPack extends ScreenHandler {
private PlayerEntity player;
private RebornInventory<?> inv;

View file

@ -58,26 +58,26 @@ public class GuiManual extends Screen {
public void init() {
int y = (height / 2) - guiHeight / 2;
y+= 40;
addButton(new GuiButtonExtended((width / 2 - 30), y + 10, 60, 20, StringUtils.t("techreborn.manual.wikibtn"), var1 -> minecraft.openScreen(new ConfirmChatLinkScreen(t -> {
addButton(new GuiButtonExtended((width / 2 - 30), y + 10, 60, 20, StringUtils.t("techreborn.manual.wikibtn"), var1 -> client.openScreen(new ConfirmChatLinkScreen(t -> {
if(t){
Util.getOperatingSystem().open("http://wiki.techreborn.ovh");
this.minecraft.openScreen(this);
this.client.openScreen(this);
} else {
this.minecraft.openScreen(this);
this.client.openScreen(this);
}
}, "http://wiki.techreborn.ovh", false))));
addButton(new GuiButtonExtended((width / 2 - 30), y + 60, 60, 20, StringUtils.t("techreborn.manual.discordbtn"), var1 -> minecraft.openScreen(new ConfirmChatLinkScreen(t -> {
addButton(new GuiButtonExtended((width / 2 - 30), y + 60, 60, 20, StringUtils.t("techreborn.manual.discordbtn"), var1 -> client.openScreen(new ConfirmChatLinkScreen(t -> {
if(t){
Util.getOperatingSystem().open("https://discord.gg/teamreborn");
this.minecraft.openScreen(this);
this.client.openScreen(this);
}else {
this.minecraft.openScreen(this);
this.client.openScreen(this);
}
}, "https://discord.gg/teamreborn", false))));
if(TechRebornConfig.allowManualRefund){
addButton(new GuiButtonExtended((width / 2 - 30), y + 110, 60, 20, StringUtils.t("techreborn.manual.refundbtn"), var1 -> {
NetworkManager.sendToServer(ServerboundPackets.createRefundPacket());
this.minecraft.openScreen(null);
this.client.openScreen(null);
}));
}
}
@ -85,14 +85,14 @@ public class GuiManual extends Screen {
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
renderBackground();
minecraft.getTextureManager().bindTexture(GuiManual.texture);
client.getTextureManager().bindTexture(GuiManual.texture);
int centerX = (width / 2) - guiWidth / 2;
int centerY = (height / 2) - guiHeight / 2;
blit(centerX, centerY, 0, 0, guiWidth, guiHeight);
font.draw(text1, ((width / 2) - font.getStringWidth(text1) / 2), centerY + 40, 4210752);
font.draw(text2, ((width / 2) - font.getStringWidth(text2) / 2), centerY + 90, 4210752);
textRenderer.draw(text1, ((width / 2) - textRenderer.getStringWidth(text1) / 2), centerY + 40, 4210752);
textRenderer.draw(text2, ((width / 2) - textRenderer.getStringWidth(text2) / 2), centerY + 90, 4210752);
if (TechRebornConfig.allowManualRefund) {
font.draw(text3, ((width / 2) - font.getStringWidth(text3) / 2), centerY + 140, 4210752);
textRenderer.draw(text3, ((width / 2) - textRenderer.getStringWidth(text3) / 2), centerY + 140, 4210752);
}
super.render(mouseX, mouseY, partialTicks);
}

View file

@ -56,20 +56,20 @@ public class GuiStorageUnit extends GuiBase<BuiltContainer> {
super.drawForeground(mouseX, mouseY);
if (storageEntity.isEmpty()) {
font.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
textRenderer.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
} else {
font.draw(StringUtils.t("gui.techreborn.storage.store"), 10, 20, 4210752);
font.draw(storageEntity.getStoredStack().getName().asString(), 10, 30, 4210752);
textRenderer.draw(StringUtils.t("gui.techreborn.storage.store"), 10, 20, 4210752);
textRenderer.draw(storageEntity.getStoredStack().getName().asString(), 10, 30, 4210752);
font.draw(StringUtils.t("gui.techreborn.storage.amount"), 10, 50, 4210752);
font.draw(String.valueOf(storageEntity.getCurrentCapacity()), 10, 60, 4210752);
textRenderer.draw(StringUtils.t("gui.techreborn.storage.amount"), 10, 50, 4210752);
textRenderer.draw(String.valueOf(storageEntity.getCurrentCapacity()), 10, 60, 4210752);
String percentFilled = String.valueOf((int) ((double) storageEntity.getCurrentCapacity() / (double) storageEntity.getMaxCapacity() * 100));
font.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752);
textRenderer.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752);
font.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
textRenderer.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
}
}
}

View file

@ -60,20 +60,20 @@ public class GuiTankUnit extends GuiBase<BuiltContainer> {
FluidInstance fluid = tankEntity.getTank().getFluidInstance();
if (fluid.isEmpty()) {
font.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
textRenderer.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752);
} else {
font.draw(StringUtils.t("gui.techreborn.tank.type"), 10, 20, 4210752);
font.draw(FluidUtil.getFluidName(fluid).replace("_", " "), 10, 30, 4210752);
textRenderer.draw(StringUtils.t("gui.techreborn.tank.type"), 10, 20, 4210752);
textRenderer.draw(FluidUtil.getFluidName(fluid).replace("_", " "), 10, 30, 4210752);
font.draw(StringUtils.t("gui.techreborn.tank.amount"), 10, 50, 4210752);
font.draw(fluid.getAmount().toString(), 10, 60, 4210752);
textRenderer.draw(StringUtils.t("gui.techreborn.tank.amount"), 10, 50, 4210752);
textRenderer.draw(fluid.getAmount().toString(), 10, 60, 4210752);
String percentFilled = String.valueOf((int) ((double) fluid.getAmount().getRawValue() / (double) tankEntity.getTank().getCapacity().getRawValue() * 100));
font.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752);
textRenderer.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752);
font.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
textRenderer.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680);
}
}

View file

@ -76,7 +76,7 @@ public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBa
if (fluid != Fluids.EMPTY) {
FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
BakedModel fluidModel = bakedModelManager.getModel(getFluidModel());
int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getBlockPos(), fluid.getDefaultState());
int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getSenseCenterPos(), fluid.getDefaultState());
Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0];
int color = new Color((float) (fluidColor >> 16 & 255) / 255.0F, (float) (fluidColor >> 8 & 255) / 255.0F, (float) (fluidColor & 255) / 255.0F).getColor();
context.pushTransform(quad -> {

View file

@ -80,7 +80,7 @@ public class EntityNukePrimed extends TntEntity {
explodeNuke();
}
} else {
this.checkWaterState();
this.updateWaterState();
this.world.addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D);
}
}
@ -89,7 +89,7 @@ public class EntityNukePrimed extends TntEntity {
if (!TechRebornConfig.nukeEnabled) {
return;
}
RebornExplosion nukeExplosion = new RebornExplosion(getBlockPos(), world, TechRebornConfig.nukeRadius);
RebornExplosion nukeExplosion = new RebornExplosion(getSenseCenterPos(), world, TechRebornConfig.nukeRadius);
nukeExplosion.setLivingBase(getCausingEntity());
nukeExplosion.explode();
}

View file

@ -108,7 +108,7 @@ public enum TRArmorMaterials implements ArmorMaterial {
}
@Override
public float method_24355() {
public float getKnockbackResistance() {
return 0; //Knockback resitance
}
}

View file

@ -35,7 +35,6 @@ import techreborn.TechReborn;
import techreborn.blockentity.cable.CableBlockEntity;
import techreborn.blockentity.machine.misc.DrainBlockEntity;
import techreborn.blockentity.machine.multiblock.casing.MachineCasingBlockEntity;
import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity;
import techreborn.blockentity.generator.LightningRodBlockEntity;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
import techreborn.blockentity.generator.SolarPanelBlockEntity;

View file

@ -42,7 +42,6 @@ import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
import techreborn.blockentity.machine.misc.DrainBlockEntity;
import techreborn.blockentity.storage.fluid.CreativeQuantumTankBlockEntity;
import techreborn.blockentity.storage.fluid.QuantumTankBlockEntity;
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
import techreborn.blockentity.generator.LightningRodBlockEntity;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
import techreborn.blockentity.generator.advanced.*;

View file

@ -79,7 +79,7 @@ public enum TRToolTier implements ToolMaterial {
}
@Override
public float getMiningSpeed() {
public float getMiningSpeedMultiplier() {
return efficiency;
}

View file

@ -77,7 +77,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
// Thanks vanilla :)
private void playEmptyingSound(@Nullable PlayerEntity playerEntity, IWorld world, BlockPos blockPos, Fluid fluid) {
SoundEvent soundEvent = fluid.matches(FluidTags.LAVA) ? SoundEvents.ITEM_BUCKET_EMPTY_LAVA : SoundEvents.ITEM_BUCKET_EMPTY;
SoundEvent soundEvent = fluid.isIn(FluidTags.LAVA) ? SoundEvents.ITEM_BUCKET_EMPTY_LAVA : SoundEvents.ITEM_BUCKET_EMPTY;
world.playSound(playerEntity, blockPos, soundEvent, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
@ -116,7 +116,7 @@ public class DynamicCellItem extends Item implements ItemFluidInfo {
if (!blockState.isAir() && !canPlace && (!(blockState.getBlock() instanceof FluidFillable) || !((FluidFillable)blockState.getBlock()).canFillWithFluid(world, pos, blockState, fluid))) {
return hitResult != null && this.placeFluid(player, world, hitResult.getBlockPos().offset(hitResult.getSide()), null, filledCell);
} else {
if (world.dimension.doesWaterVaporize() && fluid.matches(FluidTags.WATER)) {
if (world.dimension.doesWaterVaporize() && fluid.isIn(FluidTags.WATER)) {
int i = pos.getX();
int j = pos.getY();
int k = pos.getZ();

View file

@ -51,7 +51,7 @@ public class ScrapBoxItem extends Item {
List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(world);
int random = world.random.nextInt(scrapboxRecipeList.size());
ItemStack out = scrapboxRecipeList.get(random).getOutputs().get(0);
WorldUtils.dropItem(out, world, player.getBlockPos());
WorldUtils.dropItem(out, world, player.getSenseCenterPos());
stack.decrement(1);
}
return new TypedActionResult<>(ActionResult.SUCCESS, stack);

View file

@ -96,7 +96,7 @@ public class QuantumSuitItem extends TRArmourItem implements ItemStackModifiers,
if (playerEntity.abilities.flying) {
Energy.of(stack).use(flyCost);
}
playerEntity.onGround = true;
playerEntity.method_24830(true);
} else {
playerEntity.abilities.allowFlying = false;
playerEntity.abilities.flying = false;

View file

@ -73,12 +73,12 @@ public class ChainsawItem extends AxeItem implements EnergyHolder, ItemDurabilit
// AxeItem
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
if (Energy.of(stack).getEnergy() >= cost
&& (state.getMaterial() == Material.WOOD)) {
return this.poweredSpeed;
}
return super.getMiningSpeed(stack, state);
return super.getMiningSpeedMultiplier(stack, state);
}
// MiningToolItem

View file

@ -65,15 +65,15 @@ public class DrillItem extends PickaxeItem implements EnergyHolder, ItemDurabili
// PickaxeItem
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
if (Energy.of(stack).getEnergy() < cost) {
return super.getMiningSpeed(stack, state);
return super.getMiningSpeedMultiplier(stack, state);
}
if (Items.WOODEN_PICKAXE.getMiningSpeed(stack, state) > 1.0F
|| Items.WOODEN_SHOVEL.getMiningSpeed(stack, state) > 1.0F) {
if (Items.WOODEN_PICKAXE.getMiningSpeedMultiplier(stack, state) > 1.0F
|| Items.WOODEN_SHOVEL.getMiningSpeedMultiplier(stack, state) > 1.0F) {
return poweredSpeed;
}
return super.getMiningSpeed(stack, state);
return super.getMiningSpeedMultiplier(stack, state);
}
// MiningToolItem

View file

@ -60,7 +60,7 @@ public class JackhammerItem extends PickaxeItem implements EnergyHolder, ItemDur
// PickaxeItem
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
if (state.getMaterial() == Material.STONE && Energy.of(stack).getEnergy() >= cost) {
return miningSpeed;
}

View file

@ -65,11 +65,11 @@ public class RockCutterItem extends PickaxeItem implements EnergyHolder, ItemDur
}
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
if (Energy.of(stack).getEnergy() < cost) {
return 2F;
} else {
return Items.DIAMOND_PICKAXE.getMiningSpeed(stack, state);
return Items.DIAMOND_PICKAXE.getMiningSpeedMultiplier(stack, state);
}
}

View file

@ -124,7 +124,7 @@ public class IndustrialJackhammerItem extends JackhammerItem {
// PickaxeItem
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
if (state.getMaterial() == Material.STONE && Energy.of(stack).getEnergy() >= cost) {
// x4 diamond mining speed
return 32.0F;

View file

@ -75,11 +75,11 @@ public class OmniToolItem extends PickaxeItem implements EnergyHolder, ItemDurab
}
@Override
public float getMiningSpeed(ItemStack stack, BlockState state) {
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
if (Energy.of(stack).getEnergy() >= cost) {
return ToolMaterials.DIAMOND.getMiningSpeed();
return ToolMaterials.DIAMOND.getMiningSpeedMultiplier();
}
return super.getMiningSpeed(stack, state);
return super.getMiningSpeedMultiplier(stack, state);
}
// MiningToolItem

View file

@ -40,7 +40,7 @@ public class TRHoeItem extends HoeItem {
}
public TRHoeItem(ToolMaterial material, String repairOreDict) {
super(material, 0F, new Item.Settings().group(TechReborn.ITEMGROUP));
super(material, 0, 0F, new Item.Settings().group(TechReborn.ITEMGROUP));
this.repairOreDict = repairOreDict;
}