Skip to content

Commit

Permalink
Fix OC crash when not installed. Fix crossbuck graphical bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CSX8600 committed Apr 24, 2023
1 parent 0753d3e commit 915bb21
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import com.clussmanproductions.trafficcontrol.blocks.BlockTrafficLight6;
import com.clussmanproductions.trafficcontrol.blocks.BlockTrafficLightControlBox;
import com.clussmanproductions.trafficcontrol.blocks.BlockTrafficLightDoghouse;

import com.clussmanproductions.trafficcontrol.blocks.BlockTrafficRail;
import com.clussmanproductions.trafficcontrol.blocks.BlockTrafficSensorLeft;
import com.clussmanproductions.trafficcontrol.blocks.BlockTrafficSensorRight;
Expand All @@ -67,12 +66,12 @@
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLight2Frame;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLight4Frame;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLight5Frame;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLight6Frame;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLightBulb;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLightCard;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLightDoghouseFrame;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLightFrame;
import com.clussmanproductions.trafficcontrol.network.PacketHandler;
import com.clussmanproductions.trafficcontrol.oc.TrafficLightCardDriver;
import com.clussmanproductions.trafficcontrol.signs.SignRepository;
import com.clussmanproductions.trafficcontrol.tileentity.ConcreteBarrierTileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.CrossingGateGateTileEntity;
Expand All @@ -91,17 +90,15 @@
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLight2TileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLight4TileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLight5TileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLight6TileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLightControlBoxTileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLightDoghouseTileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLightTileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.Type3BarrierTileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.WCHBellTileEntity;
import com.clussmanproductions.trafficcontrol.tileentity.WigWagTileEntity;
import com.clussmanproductions.trafficcontrol.item.ItemTrafficLight6Frame;
import com.clussmanproductions.trafficcontrol.tileentity.TrafficLight6TileEntity;

import com.clussmanproductions.trafficcontrol.util.OpenComputersHelper;

import li.cil.oc.api.Driver;
import net.minecraft.block.Block;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
Expand All @@ -110,8 +107,8 @@
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.ProgressManager;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.ProgressManager;
import net.minecraftforge.fml.common.ProgressManager.ProgressBar;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
Expand Down Expand Up @@ -320,15 +317,10 @@ public void init(FMLInitializationEvent e)

if (ModTrafficControl.OC_INSTALLED)
{
addOCDriver();
OpenComputersHelper.addOCDriver();
}
}

private void addOCDriver()
{
Driver.add(new TrafficLightCardDriver() );
}

@SideOnly(Side.CLIENT)
ProgressBar signLoadProgress;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.clussmanproductions.trafficcontrol.util;

import com.clussmanproductions.trafficcontrol.oc.TrafficLightCardDriver;

import li.cil.oc.api.Driver;

public class OpenComputersHelper {

public static void addOCDriver()
{
Driver.add(new TrafficLightCardDriver() );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"to": [17.5, 9, 17],
"rotation": {"angle": -45, "axis": "z", "origin": [8, 7.5, 16.5]},
"faces": {
"north": {"uv": [0, 7, 19, 10], "texture": "#0"},
"north": {"uv": [0, 7, 16, 10], "texture": "#0"},
"east": {"uv": [0, 0, 1, 3], "texture": "#0"},
"south": {"uv": [0, 0.4, 16, 2.5], "texture": "#1"},
"west": {"uv": [0, 0, 1, 3], "texture": "#0"},
"up": {"uv": [0, 6, 19, 7], "texture": "#1"},
"down": {"uv": [0, 7, 19, 8], "texture": "#1"}
"up": {"uv": [0, 6, 16, 7], "texture": "#1"},
"down": {"uv": [0, 7, 16, 8], "texture": "#1"}
}
},
{
Expand All @@ -28,12 +28,12 @@
"to": [17.5, 9, 17.1],
"rotation": {"angle": 45, "axis": "z", "origin": [8, 7.5, 16.5]},
"faces": {
"north": {"uv": [0, 0, 19, 3], "texture": "#0"},
"north": {"uv": [0, 0, 16, 3], "texture": "#0"},
"east": {"uv": [0, 0, 1, 3], "texture": "#0"},
"south": {"uv": [0, 3.3, 16, 5.5], "texture": "#1"},
"west": {"uv": [0, 6, 1, 9], "texture": "#1"},
"up": {"uv": [0, 7, 19, 8], "texture": "#1"},
"down": {"uv": [0, 6, 19, 7], "texture": "#1"}
"up": {"uv": [0, 7, 16, 8], "texture": "#1"},
"down": {"uv": [0, 6, 16, 7], "texture": "#1"}
}
},
{
Expand Down

0 comments on commit 915bb21

Please sign in to comment.