Skip to content

Commit

Permalink
bump to 19w02a
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Jan 9, 2019
1 parent 0daaf37 commit f52a1c7
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 216 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ archivesBaseName = "infraredstone"


ext {
standardVersion = "18w50a-1.0.1"
standardVersion = "19w02a-1.0.1"
}

repositories {
Expand All @@ -43,10 +43,10 @@ repositories {
}

dependencies {
minecraft "com.mojang:minecraft:18w50a"
mappings "net.fabricmc:yarn:18w50a.71"
modCompile "net.fabricmc:fabric-loader:0.3.0.75"
modCompile "net.fabricmc:fabric:0.1.2.64"
minecraft "com.mojang:minecraft:19w02a"
mappings "net.fabricmc:yarn:19w02a.12"
modCompile "net.fabricmc:fabric-loader:0.3.2.92"
modCompile "net.fabricmc:fabric:0.1.4.71"
implementation 'org.jetbrains:annotations:15.0'
modCompile "io.github.prospector.silk:SilkAPI:1.0.0-26"
modCompile name: "qcommon-architect-1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.elytradev.infraredstone.Container;

import com.elytradev.infraredstone.block.entity.OscillatorBlockEntity;
import net.minecraft.class_3917;
import net.minecraft.container.Container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
Expand All @@ -10,11 +11,17 @@ public class OscillatorContainer extends Container {
BlockPos pos;
OscillatorBlockEntity be;

public OscillatorContainer(BlockPos pos, PlayerEntity player) {
public OscillatorContainer(int id, BlockPos pos, PlayerEntity player) {
super(id);
this.pos = pos;
this.be = (OscillatorBlockEntity)player.getEntityWorld().getBlockEntity(pos);
}

@Override
public class_3917<?> method_17358() {
return null;
}

@Override
public boolean canUse(PlayerEntity player) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.ContainerGui;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.text.TextFormat;
import net.minecraft.text.TranslatableTextComponent;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;

public class OscillatorContainerGui extends ContainerGui {

private static final Identifier TEXTURE = new Identifier("infraredstone:textures/gui/gui_oscillator.png");


BlockPos pos;
OscillatorBlockEntity be;

public OscillatorContainerGui(BlockPos pos, PlayerEntity player) {
super(new OscillatorContainer(pos, player));
public OscillatorContainerGui(int id, BlockPos pos, PlayerEntity player) {
super(new OscillatorContainer(id, pos, player), player.inventory, new TranslatableTextComponent("container.infraredstone.oscillator"));
this.pos = pos;
this.be = (OscillatorBlockEntity)player.getEntityWorld().getBlockEntity(pos);
be.fromTag(player.getEntityWorld().getBlockEntity(pos).toTag(new CompoundTag()));
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/elytradev/infraredstone/InfraRedstone.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.fabricmc.fabric.api.container.ContainerProviderRegistry;
import net.fabricmc.fabric.events.TickEvent;
import net.fabricmc.fabric.impl.container.ContainerProviderImpl;
import net.minecraft.container.ContainerProvider;
import net.minecraft.item.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
Expand All @@ -20,16 +22,15 @@ public class InfraRedstone implements ModInitializer {

public static final Identifier OSCILLATOR_CONTAINER = new Identifier("infraredstone:oscillator_container");


@Override
public void onInitialize() {
ModBlocks.init();
ModItems.init();
TickEvent.SERVER.register(InRedLogic.onServerTick);
//Registers a container factory that opens our example Container, this reads the block pos from the buffer
ContainerProviderRegistry.INSTANCE.registerFactory(OSCILLATOR_CONTAINER, (identifier, player, buf) -> {
ContainerProviderRegistry.INSTANCE.registerFactory(OSCILLATOR_CONTAINER, (syncId, suidentifier, player, buf) -> {
BlockPos pos = buf.readBlockPos();
return new OscillatorContainer(pos, player);
return new OscillatorContainer(syncId, pos, player);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public void onInitializeClient() {
BlockEntityRendererRegistry.INSTANCE.register(ShifterBlockEntity.class, new ShifterRenderer());
BlockEntityRendererRegistry.INSTANCE.register(EncoderBlockEntity.class, new EncoderRenderer());

GuiProviderRegistry.INSTANCE.registerFactory(InfraRedstone.OSCILLATOR_CONTAINER, (identifier, player, buf) -> {
GuiProviderRegistry.INSTANCE.registerFactory(InfraRedstone.OSCILLATOR_CONTAINER, (syncId, identifier, player, buf) -> {
BlockPos pos = buf.readBlockPos();
return new OscillatorContainerGui(pos, player);
return new OscillatorContainerGui(syncId, pos, player);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.elytradev.infraredstone.block.entity.AndGateBlockEntity;
import com.elytradev.infraredstone.util.enums.InactiveSelection;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderLayer;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.block.BlockRenderLayer;
import net.minecraft.entity.VerticalEntityPosition;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
Expand Down Expand Up @@ -82,26 +82,6 @@ public boolean activate(BlockState state, World world, BlockPos pos, PlayerEntit
return true;
}

@Override
public boolean isSimpleFullBlock(BlockState blockState, BlockView blockView, BlockPos blockPos) {
return false;
}

@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.SOLID;
}

@Override
public VoxelShape getCollisionShape(BlockState blockState, BlockView blockView, BlockPos blockPos, VerticalEntityPosition verticalEntityPosition) {
return VoxelShapes.empty();
}

@Override
public VoxelShape getBoundingShape(BlockState state, BlockView view, BlockPos pos) {
return BASE_SHAPE;
}

@Override
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
builder.with(FACING, BOOLEAN_MODE, INACTIVE);
Expand Down
23 changes: 0 additions & 23 deletions src/main/java/com/elytradev/infraredstone/block/DiodeBlock.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.elytradev.infraredstone.block;

import com.elytradev.infraredstone.block.entity.DiodeBlockEntity;
import net.fabricmc.fabric.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.block.BlockRenderLayer;
import net.minecraft.entity.VerticalEntityPosition;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
Expand Down Expand Up @@ -102,26 +99,6 @@ public boolean activate(BlockState state, World world, BlockPos pos, PlayerEntit
return true;
}

@Override
public boolean isSimpleFullBlock(BlockState blockState, BlockView blockView, BlockPos blockPos) {
return false;
}

@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.SOLID;
}

@Override
public VoxelShape getCollisionShape(BlockState blockState, BlockView blockView, BlockPos blockPos, VerticalEntityPosition verticalEntityPosition) {
return VoxelShapes.empty();
}

@Override
public VoxelShape getBoundingShape(BlockState state, BlockView view, BlockPos pos) {
return BASE_SHAPE;
}

@Override
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
builder.with(FACING, BIT_0, BIT_1, BIT_2, BIT_3, BIT_4, BIT_5);
Expand Down
25 changes: 0 additions & 25 deletions src/main/java/com/elytradev/infraredstone/block/EncoderBlock.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
package com.elytradev.infraredstone.block;

import com.elytradev.infraredstone.block.entity.EncoderBlockEntity;
import net.fabricmc.fabric.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.block.BlockRenderLayer;
import net.minecraft.entity.VerticalEntityPosition;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateFactory;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;

Expand All @@ -32,26 +27,6 @@ public BlockEntity createBlockEntity(BlockView blockView) {
return new EncoderBlockEntity();
}

@Override
public boolean isSimpleFullBlock(BlockState blockState, BlockView blockView, BlockPos blockPos) {
return false;
}

@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.SOLID;
}

@Override
public VoxelShape getCollisionShape(BlockState blockState, BlockView blockView, BlockPos blockPos, VerticalEntityPosition verticalEntityPosition) {
return VoxelShapes.empty();
}

@Override
public VoxelShape getBoundingShape(BlockState state, BlockView view, BlockPos pos) {
return BASE_SHAPE;
}

@Override
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
builder.with(FACING);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.elytradev.infraredstone.block;

import com.elytradev.infraredstone.api.SimpleInfraRedstoneSignal;
import com.elytradev.infraredstone.api.InfraRedstoneCapable;
import com.elytradev.infraredstone.logic.InRedLogic;
import com.elytradev.infraredstone.util.enums.CableConnection;
import net.fabricmc.fabric.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderLayer;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.block.BlockRenderLayer;
import net.minecraft.entity.VerticalEntityPosition;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.elytradev.infraredstone.block;

import com.elytradev.infraredstone.api.InfraRedstoneCapable;
import com.elytradev.infraredstone.api.SimpleInfraRedstoneSignal;
import net.fabricmc.fabric.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderLayer;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.client.render.block.BlockRenderLayer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.VerticalEntityPosition;
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/elytradev/infraredstone/block/ModuleBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import net.fabricmc.fabric.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.VerticalEntityPosition;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import io.github.prospector.silk.block.SilkBlockWithEntity;
import net.minecraft.world.ViewableWorld;
Expand Down Expand Up @@ -51,4 +53,24 @@ public boolean canPlaceAt(BlockState state, ViewableWorld world, BlockPos pos) {
|| world.getBlockState(pos.down()).getBlock() == ModBlocks.IN_RED_SCAFFOLD
|| world.getBlockState(pos.down()).getBlock() == ModBlocks.IN_RED_BLOCK;
}

@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.SOLID;
}

@Override
public boolean isSimpleFullBlock(BlockState blockState, BlockView blockView, BlockPos blockPos) {
return false;
}

@Override
public VoxelShape getCollisionShape(BlockState blockState, BlockView blockView, BlockPos blockPos, VerticalEntityPosition verticalEntityPosition) {
return VoxelShapes.empty();
}

@Override
public VoxelShape getBoundingShape(BlockState state, BlockView view, BlockPos pos) {
return BASE_SHAPE;
}
}
23 changes: 0 additions & 23 deletions src/main/java/com/elytradev/infraredstone/block/NotGateBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.block.BlockRenderLayer;
import net.minecraft.entity.VerticalEntityPosition;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateFactory;
Expand All @@ -17,7 +15,6 @@
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;

Expand Down Expand Up @@ -67,26 +64,6 @@ public boolean activate(BlockState state, World world, BlockPos pos, PlayerEntit
return true;
}

@Override
public boolean isSimpleFullBlock(BlockState blockState, BlockView blockView, BlockPos blockPos) {
return false;
}

@Override
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.SOLID;
}

@Override
public VoxelShape getCollisionShape(BlockState blockState, BlockView blockView, BlockPos blockPos, VerticalEntityPosition verticalEntityPosition) {
return VoxelShapes.empty();
}

@Override
public VoxelShape getBoundingShape(BlockState state, BlockView view, BlockPos pos) {
return BASE_SHAPE;
}

@Override
protected void appendProperties(StateFactory.Builder<Block, BlockState> builder) {
builder.with(FACING, BOOLEAN_MODE);
Expand Down
Loading

0 comments on commit f52a1c7

Please sign in to comment.