Skip to content

Commit

Permalink
Port to 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
PTOM76 committed Sep 19, 2021
1 parent fb31950 commit 261920f
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 104 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'fabric-loom' version '0.7-SNAPSHOT'
id 'fabric-loom' version '0.9-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand All @@ -21,8 +21,8 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// TRのエネルギー用
modImplementation 'RebornCore:RebornCore-1.16:+'
modImplementation 'TechReborn:TechReborn-1.16:+'
modImplementation 'RebornCore:RebornCore-1.17:+'
modImplementation 'TechReborn:TechReborn-1.17:+'
}

processResources {
Expand All @@ -36,7 +36,7 @@ processResources {
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

def targetVersion = 8
def targetVersion = 16
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
org.gradle.jvmargs=-Xmx3G

minecraft_version=1.16.5
yarn_mappings=1.16.5+build.10
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.61
loader_version=0.11.6

fabric_version=0.40.1+1.16
fabric_version=0.40.1+1.17

mod_version = 1.0.0
mod_version = 1.0.1
maven_group = ml.pkom
archives_base_name = EnhancedQuarries
archives_base_name = EnhancedQuarries-1.17.1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EnhancedQuarries implements ModInitializer {

public static final String MOD_ID = "enhanced_quarries";
public static final String MOD_NAME = "Enhanced Quarries";
public static final String VERSION = "1.0.0";
public static final String VERSION = "1.0.1";
public static EnhancedQuarries instance;
private static final Logger LOGGER = LogManager.getLogger();

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/ml/pkom/enhancedquarries/block/NormalMarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,37 @@ public static void searchMarker(World world, BlockPos pos, List<BlockStatePos> l
blockPosList.add(blockStatePos.getBlockPos());
}
blockState = world.getBlockState(blockPosX1);
if (blockState.getBlock().is(Blocks.NORMAL_MARKER))
if (blockState.getBlock().equals(Blocks.NORMAL_MARKER))
if (!blockPosList.contains(blockPosX1)) {
list.add(new BlockStatePos(blockState, blockPosX1, world));
searchMarker(world, blockPosX1, list);
}
blockState = world.getBlockState(blockPosX2);
if (blockState.getBlock().is(Blocks.NORMAL_MARKER))
if (blockState.getBlock().equals(Blocks.NORMAL_MARKER))
if (!blockPosList.contains(blockPosX2)) {
list.add(new BlockStatePos(blockState, blockPosX2, world));
searchMarker(world, blockPosX2, list);
}
blockState = world.getBlockState(blockPosY1);
if (blockState.getBlock().is(Blocks.NORMAL_MARKER))
if (blockState.getBlock().equals(Blocks.NORMAL_MARKER))
if (!blockPosList.contains(blockPosY1)) {
list.add(new BlockStatePos(blockState, blockPosY1, world));
searchMarker(world, blockPosY1, list);
}
blockState = world.getBlockState(blockPosY2);
if (blockState.getBlock().is(Blocks.NORMAL_MARKER))
if (blockState.getBlock().equals(Blocks.NORMAL_MARKER))
if (!blockPosList.contains(blockPosY2)) {
list.add(new BlockStatePos(blockState, blockPosY2, world));
searchMarker(world, blockPosY2, list);
}
blockState = world.getBlockState(blockPosZ1);
if (blockState.getBlock().is(Blocks.NORMAL_MARKER))
if (blockState.getBlock().equals(Blocks.NORMAL_MARKER))
if (!blockPosList.contains(blockPosZ1)) {
list.add(new BlockStatePos(blockState, blockPosZ1, world));
searchMarker(world, blockPosZ1, list);
}
blockState = world.getBlockState(blockPosZ2);
if (blockState.getBlock().is(Blocks.NORMAL_MARKER))
if (blockState.getBlock().equals(Blocks.NORMAL_MARKER))
if (!blockPosList.contains(blockPosZ2)) {
list.add(new BlockStatePos(blockState, blockPosZ2, world));
searchMarker(world, blockPosZ2, list);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package ml.pkom.enhancedquarries.screen;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import ml.pkom.enhancedquarries.EnhancedQuarries;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
Expand All @@ -25,8 +27,9 @@ protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int
int x = (this.width - this.backgroundWidth) / 2;
int y = (this.height - this.backgroundHeight) / 2;

GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
MinecraftClient.getInstance().getTextureManager().bindTexture(GUI);
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, GUI);
drawTexture(matrices, x, y, 0, 0, this.backgroundWidth, this.backgroundHeight);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

import ml.pkom.enhancedquarries.event.TileCreateEvent;
import ml.pkom.enhancedquarries.tile.base.FillerTile;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;

public class EnhancedFillerTile extends FillerTile {

public EnhancedFillerTile() {
super(Tiles.ENHANCED_FILLER_TILE);
public EnhancedFillerTile(BlockPos pos, BlockState state) {
super(Tiles.ENHANCED_FILLER_TILE, pos, state);
}

public EnhancedFillerTile(TileCreateEvent event) {
this();
this(event.getBlockPos(), event.getBlockState());
}

@Override
Expand All @@ -30,12 +32,12 @@ public void coolTimeBonus() {
}

@Override
public double getBaseMaxPower() {
public long getBaseMaxPower() {
return 10000;
}

@Override
public double getBaseMaxInput() {
public long getBaseMaxInput() {
return super.getBaseMaxInput() * 3;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

import ml.pkom.enhancedquarries.event.TileCreateEvent;
import ml.pkom.enhancedquarries.tile.base.QuarryTile;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.BlockPos;

public class EnhancedQuarryTile extends QuarryTile {

public EnhancedQuarryTile() {
super(Tiles.ENHANCED_QUARRY_TILE);
public EnhancedQuarryTile(BlockPos pos, BlockState state) {
super(Tiles.ENHANCED_QUARRY_TILE, pos, state);
}

// 継承のため
public EnhancedQuarryTile(BlockEntityType<?> type) {
super(type);
public EnhancedQuarryTile(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}

public EnhancedQuarryTile(TileCreateEvent event) {
this();
this(event.getBlockPos(), event.getBlockState());
}

@Override
Expand All @@ -36,12 +38,12 @@ public void coolTimeBonus() {
}

@Override
public double getBaseMaxPower() {
public long getBaseMaxPower() {
return 10000;
}

@Override
public double getBaseMaxInput() {
public long getBaseMaxInput() {
return super.getBaseMaxInput() * 3;
}

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/ml/pkom/enhancedquarries/tile/FluidQuarryTile.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
package ml.pkom.enhancedquarries.tile;

import ml.pkom.enhancedquarries.event.TileCreateEvent;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.BlockPos;

public class FluidQuarryTile extends EnhancedQuarryTile {

public FluidQuarryTile() {
super(Tiles.FLUID_QUARRY_TILE);
public FluidQuarryTile(BlockPos pos, BlockState state) {
super(Tiles.FLUID_QUARRY_TILE, pos, state);
}

// 継承のため
public FluidQuarryTile(BlockEntityType<?> type) {
super(type);
public FluidQuarryTile(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}

public FluidQuarryTile(TileCreateEvent event) {
this();
this(event.getBlockPos(), event.getBlockState());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import ml.pkom.enhancedquarries.event.TileCreateEvent;
import ml.pkom.enhancedquarries.tile.base.FillerTile;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;

public class NormalFillerTile extends FillerTile {

public NormalFillerTile() {
super(Tiles.NORMAL_FILLER_TILE);
public NormalFillerTile(BlockPos pos, BlockState state) {
super(Tiles.NORMAL_FILLER_TILE, pos, state);
}

public NormalFillerTile(TileCreateEvent event) {
this();
this(event.getBlockPos(), event.getBlockState());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import ml.pkom.enhancedquarries.event.TileCreateEvent;
import ml.pkom.enhancedquarries.tile.base.QuarryTile;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;

public class NormalQuarryTile extends QuarryTile {

public NormalQuarryTile() {
super(Tiles.NORMAL_QUARRY_TILE);
public NormalQuarryTile(BlockPos pos, BlockState state) {
super(Tiles.NORMAL_QUARRY_TILE, pos, state);
}

public NormalQuarryTile(TileCreateEvent event) {
this();
this(event.getBlockPos(), event.getBlockState());
}
}
5 changes: 3 additions & 2 deletions src/main/java/ml/pkom/enhancedquarries/tile/Tiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ml.pkom.enhancedquarries.Blocks;
import ml.pkom.enhancedquarries.EnhancedQuarries;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
Expand All @@ -25,8 +26,8 @@ public static void init() {
ENHANCED_FILLER_TILE = Registry.register(Registry.BLOCK_ENTITY_TYPE, EnhancedQuarries.id("enhanced_filler_tile"), create(EnhancedFillerTile::new, Blocks.ENHANCED_FILLER));
}

public static <T extends BlockEntity> BlockEntityType create(Supplier supplier, Block... blocks) {
return BlockEntityType.Builder.create(supplier, blocks).build(null);
public static <T extends BlockEntity> BlockEntityType<T> create(FabricBlockEntityTypeBuilder.Factory<T> supplier, Block... blocks) {
return FabricBlockEntityTypeBuilder.create(supplier, blocks).build(null);
}

}
Loading

0 comments on commit 261920f

Please sign in to comment.