mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-30 13:13:00 +00:00 
			
		
		
		
	Allow turtle upgrades to act as tools and peripherals
This may be useful when you want your tool to also provide additional methods. For instance, a pickaxe could provide methods to check whether it can break the block in front.
This commit is contained in:
		| @@ -24,4 +24,22 @@ public enum TurtleUpgradeType | ||||
|      * and can be interacted with the peripheral API (Such as the modem on Wireless Turtles). | ||||
|      */ | ||||
|     Peripheral, | ||||
|  | ||||
|     /** | ||||
|      * An upgrade which provides both a tool and a peripheral. This can be used when you wish | ||||
|      * your upgrade to also provide methods. For example, a pickaxe could provide methods | ||||
|      * determining whether it can break the given block or not. | ||||
|      */ | ||||
|     Both, | ||||
|     ; | ||||
|  | ||||
|     public boolean isTool() | ||||
|     { | ||||
|         return this == Tool || this == Both; | ||||
|     } | ||||
|  | ||||
|     public boolean isPeripheral() | ||||
|     { | ||||
|         return this == Peripheral || this == Both; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SquidDev
					SquidDev